public void FileDownload(string Servername, string username, string Pwd, string Filename) { try { WebProxy prox = new WebProxy(); prox.UseDefaultCredentials = true; WebClient request = new WebClient(); request.Credentials = new NetworkCredential(username, Pwd); request.Proxy = prox; byte[] fileData = request.DownloadData(Servername + "/" + "/fashionretailkz/SHIPMENTFILES/IN/" + Filename); DirectoryInfo di = new DirectoryInfo(txtdrive.Text +@"\DownloadfilefrmTAP"); if (di.Exists == false) di.Create(); FileStream file = File.Create(txtdrive.Text +@"\\DownloadfilefrmTAP\" + Filename); file.Write(fileData, 0, fileData.Length); file.Close(); } catch (SystemException ex) { Logs.MakeLog(Application.StartupPath.ToString(), ex.ToString()); } }
OP wrote:I install new windows
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)