public static void Download(string FTPFullFileName, string DestFullFileName) { try { DestFullFileName = DestFullFileName.Replace("/", "\\"); int indexPart = DestFullFileName.LastIndexOf("\\"); if (indexPart != -1) { String DestFolder = DestFullFileName.Substring(0, indexPart + 1); if (!System.IO.Directory.Exists(DestFolder)) Directory.CreateDirectory(DestFolder); } FtpWebRequest FTP = (FtpWebRequest)FtpWebRequest.Create(FTPFullFileName); FTP.Method = WebRequestMethods.Ftp.DownloadFile; FTP.UseBinary = true; FTP.Proxy = null; } }
protected void LinkButton1_Click(object sender, EventArgs e) { Download("D://Error.txt", @"E://Error.txt"); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)