Encryptor Samples

Connection

Ultimate FTP makes it so easy to establish secure connections to your FTP servers.

Connect to an FTP server

In order to use the Ftp and other classes, you have to add references to ComponentPro.Ftp.dll, ComponentPro.Common.dll, ComponentPro.Network.dll, and ComponentPro.FileSystem.dll assemblies to your project.

To authenticate to an FTP server, you can simply perform the following steps

  • Add using directives to your code to create aliases for existing namespaces and avoid having to type the fully qualified type names.
  • Create a new instance of the Ftp class.
  • Now you can connect to the FTP server with Connect methods.
  • Call the Disconnect method to close the FTP session when done.
// Create a new class instance.
Ftp client = new Ftp();

// Connect to the FTP server.
client.Connect("myserver");

// Or you can specify the FTP port with
// client.Connect("myserver", 21);

// Authenticate.
client.Authenticate("userName", "password");

// Do something here...
client.DownloadFile("/my remote file.dat", "my local file");

// Disconnect.
client.Disconnect();
' Create a new class instance.
Dim client As New Ftp()

' Connect to the FTP server.
client.Connect("myserver")

' Or you can specify the FTP port with
' client.Connect("myserver", 21);

' Authenticate.
client.Authenticate("userName", "password")

' Do something here...
client.DownloadFile("/my remote file.dat", "my local file")

' Disconnect.
client.Disconnect()
// Create a new class instance.
using (Ftp client = new Ftp())
{
    // Connect to the FTP server.
    client.Connect("myserver", 21, SslSecurityMode.Explicit);

    // Authenticate.
    client.Authenticate("userName", "password");

    // Do something here...
    client.DownloadFile("/my remote file.dat", "my local file");
}
' Create a new class instance.
Using client As New Ftp()
    ' Connect to the FTP server.
    client.Connect("myserver", 21, SslSecurityMode.Explicit)

    ' Authenticate.
    client.Authenticate("userName", "password")

    ' Do something here...
    client.DownloadFile("/my remote file.dat", "my local file")
End Using

Explicit and Implicit SSL support

Explicit connection and Implicit connection are two secure methods used to connect to a secure FTP server. Ultimate FTP supports both Explicit and Implicit SSL modes.

It also allows you to upgrade an unsecured connection to secure or downgrade a secure connection to unsecure.

Data Transfer Encryption

To enable data transfer encryption, set the SecureDataTransfers property to true. To disable, set the that property to false.