2
Good afternoon, I am generating a file with Asp net the function saved in the hard drive if I put the path, however this file will be saved in a server and I’m having difficulty to put the relative path of where this file will be saved, I don’t know if I’m using the right function because I’m new.
function I’m using:
string[] lines = {ENAME, FNAME,LNAME };
System.IO.File.WriteAllLines(@"~/WriteLines.csv", lines);
error generated:
Details of Exception§System.IO.Directorynotfoundexception: Unable to locate a part of the path 'C: Program Files (x86) IIS Express ~ Writelines.csv'.
This might help you: https://stackoverflow.com/questions/1268738/asp-net-mvc-find-absolute-path-to-the-app-data-folder-from-controller
– Victor Laio