hot to transfer from FTP to local directory on my computer in C#
-
i have FTP server in my computer (Windows-7) called MyFTP i have thit code to transfer from local directory to FTP server this code work excellent string MyFile = @"d:\Test.txt"; //string url = "ftpUrl/FileName"; string url = "ftp://127.0.0.1/Test.txt"; FtpWebRequest request = (FtpWebRequest)FtpWebRequest.Create(url); request.Method = WebRequestMethods.Ftp.UploadFile; //request.Credentials = new NetworkCredential("user name", "password"); request.UsePassive = true; request.UseBinary = true; request.KeepAlive = false; byte[] buffer = File.ReadAllBytes(MyFile); using (Stream reqStream = request.GetRequestStream()) { reqStream.Write(buffer, 0, buffer.Length); } and now i need to to transfer from FTP server to local directory in my computer how to do it ?
modified on Thursday, August 11, 2011 5:11 PM