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

Suthish NairPosted Jun 3, 2011, 2:08 AM
Amit ChoudharyPosted Jun 3, 2011, 12:37 AM
Morcos AdelPosted Jun 1, 2011, 10:34 AM
Couldn't find the file z:\Reading Trial\NewDocument.docx
Amit ChoudharyPosted Jun 1, 2011, 10:00 AM
String Path = Server.MapPath("~/test/" + Trial + "NewDocument.docx");
This will solve your problem.