Xceed FTP Library Documentation
Example topics / Receiving files (C# example)
In This Topic
    Receiving files (C# example)
    In This Topic
    C# Copy Code

    // The following example demonstrates how to connect to a
    // FTP server and download a file.

    XceedFtpLib.XceedFtp ftp = new XceedFtpLib.XceedFtpClass();

    ftp.License( @"your license key" );

    // Specify the FTP server's address
    ftp.ServerAddress = @"ftp.cdrom.com";

    // Specify the username and password to login
    ftp.UserName = "anonymous";
    ftp.Password = "guest";

    try
    {
       // Connect to the FTP server
       ftp.Connect();

       // Receive files
       ftp.ReceiveFile( "UPLOADS.TXT", 0, @"c:\test\uploads.txt" );

       // Disconnect from the FTP server
       ftp.Disconnect();
    }
    catch( System.Runtime.InteropServices.COMException except )
    {
       MessageBox.Show( except.ToString() );
    }