need help with getting asp.net webserver current directory
I am trying to save a file to one of the folders in the webserver, where the asp.net files are deployed. On my dev pc, I used Environment.CurrentDirecotory and Directory.CurrentDirectory. I get the following values
"C:\\Program Files\\Microsoft Visual Studio 8\\Common7\\IDE"
I assume this will not be the value when the code is executed on the webserver. Originally, I thought the return path is where the aspx file was located and the correct path is something like this..."../folder/file.txt"
How do I get the correct folder path on the server or how about to approach the problem?
thanks..
Re: need help with getting asp.net webserver current directory
I think (i am not sure) that the visual studio webserver is located in "C:\\Program Files\\Microsoft Visual Studio 8\\Common7\\IDE".
Re: need help with getting asp.net webserver current directory
Hi, as far as I have understood your problem, why don't you try to use the Server.MapPath() method to store the data. Also if you are viewing the path only, then you can use the Request.ServerVariables method to find the exact path and use it for storing the data. The use of the appropriate server variable can be checked when you put the trace="true" in the page directive.