Friday, October 2, 2009

Download file form web / IE without Save/Open dialog box

string url = "http://"; // Download File path
System.Net.WebClient myWebClient = new System.Net.WebClient();
myWebClient.Credentials = new System.Net.NetworkCredential("User Name", "Password", "Domain");

string sFile ="C:\\"; //Path to save file

myWebClient.DownloadFile(url, sFile);

No comments: