hi
i have a problem with web site published on windows server 2008 i think the version of the iis is 7...
scenario:
on this server i have a shared network folder (z:) and i have all the permissions to access all the documents on it,From the iis i create a
virtual directory named test and then the alias is test and physical path
point to the (Z:) drive and when i browse this folder it realy is showing me
the data in the (Z:) drive....
what really confuses me now is how to access this folder from my code specially that i didn't create it when i built my webapplication...
in the code i wrote :
String Path = "~/test/" + Trial + "NewDocument.docx";
String Text = ReadTextFile(Path);
and i get the following error:
Could not find a part of the path
'c:\windows\system32\inetsrv\~\test\Reading Trial\NewDocument.docx'.
any ideas to solve this problem would be great...
Thanks in advance....
Loading


Amit ChoudharyRank #145 · 15.8K reputationPosted Jun 1, 2011, 6:00 AM EDT
String Path = Server.MapPath("~/test/" + Trial + "NewDocument.docx");
This will solve your problem.
Morcos Adel115 reputationPosted Jun 1, 2011, 6:34 AM EDT
Couldn't find the file z:\Reading Trial\NewDocument.docx
Amit ChoudharyRank #145 · 15.8K reputationPosted Jun 2, 2011, 8:37 PM EDT
Suthish NairRank #92 · 22.8K reputationPosted Jun 2, 2011, 10:08 PM EDT