please see this thread :
path of desktop for current user
this code (mean path) in my local machine was ok, but after publishing returns nothing…
i mean Environment.GetFolderPath(Environment.SpecialFolder.Desktop) is empty after publish…
string path = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
Response.Write(path);
Response.Write("<br />");
Response.Write(Server.MapPath("/") + "myfile.htm");
Response.Write("<br />");
//string[] directory_list = Directory.GetDirectories(path);
//foreach (string directory in directory_list)
//{
// if (directory.Contains("blablabla"))
// {
// string sumfilePath = directory + @"\Sum.txt";
// Response.Write(sumfilePath);
// }
//}
what is going on and how can i fix it?
If the site is not running as a user with Interactive Logon privilege, there will be no desktop associated with that user.
That will typically be the case for an application pool in IIS.
It would not be wise to run the application pool with Interactive Logon because it creates a security hole.