|
How to connect to an FTP server
|
|
Connecting to an FTP server with edtFTPnet/Express is simply a matter of:
FTPConnection ftpConnection = new FTPConnection();
2. Setting the address and login properties
ftpConnection.ServerAddress = "";
ftpConnection.ServerPort = serverPort;
ftpConnection.UserName = userName;
ftpConnection.Password = password;
3. Calling the Connect() method.
ftpConnection.Connect();
The Connect call will return when it's successfully connected and logged into the server, or
throw an exception if it fails to connect or log in.
Note that ExFTPConnection also offers an
asynchronous version of the Connect method,
called BeginConnect, which returns instantly and performs the connection/login operation in
the background. Please refer to the How to use asynchronous methods topic to learn more
about this.