Reputation: 97
HttpWebRequest myHttpWebRequest = (HttpWebRequest)WebRequest.Create("http://localhost:51659/jobpoint3.0/Default4.aspx");
WebClient client = new WebClient();
string filename = @"C:/Users/leema/" + txtsave.Text;
client.DownloadFile("http://localhost:51659/jobpoint3.0/Default4.aspx", @"C:/Users/leema/"+ txtsave.Text);
//HttpResponseWriteFile(filename);
HttpWebResponse myHttpWebResponse = (HttpWebResponse)myHttpWebRequest.GetResponse();
myHttpWebResponse.Close();
here i'm getting the local path.. how do i get user's desktop path for any user??
Upvotes: 0
Views: 385
Reputation: 17941
The code is
Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory)
so your line no.3 will be modified to
string filename = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory), txtsave.Text);
Upvotes: 0