This project is read-only.

Project Description
This library wraps the wininet.dll functions for FTP to create an effective way to interact with FTP servers using the C# language and the .Net framework.

Sample Code

  using (FtpConnection ftp = new FtpConnection("ftpserver", "username", "password"))
                ftp.Open(); /* Open the FTP connection */
                ftp.Login(); /* Login using previously provided credentials */

                if (ftp.DirectoryExists("/incoming")) /* check that a directory exists */
                    ftp.SetCurrentDirectory("/incoming"); /* change current directory */

                if (ftp.FileExists("/incoming/file.txt"))  /* check that a file exists */
                    ftp.GetFile("/incoming/file.txt", false); /* download /incoming/file.txt as file.txt to current executing directory, overwrite if it exists */

                //do some processing

                    ftp.PutFile(@"c:\localfile.txt", "file.txt"); /* upload c:\localfile.txt to the current ftp directory as file.txt */
                catch (FtpException e)
                    Console.WriteLine(String.Format("FTP Error: {0} {1}", e.ErrorCode, e.Message));

                foreach(var dir in ftp.GetDirectories("/incoming/processed"))
                    foreach (var file in dir.GetFiles())

   Buy me a beer!


ndepend image
NDepend is a Visual Studio tool to manage complex .NET code and achieve high Code Quality

Last edited Jan 13, 2011 at 3:16 PM by scottmeyer, version 22