-
-
Notifications
You must be signed in to change notification settings - Fork 656
Automatic Connection
Robinicks edited this page Feb 5, 2020
·
24 revisions
-
AutoDetect() - Automatically discover working FTP connection settings and return those connection profiles.
-
AutoConnect() - Automatically discover working FTP connection settings and use those to connect to the server.
Use this code:
FtpClient client = new FtpClient(hostname, username, password); // or set Host & Credentials
var profiles = client.AutoDetect();
// if any profiles are found, print the code to the console
if (profiles.Count > 0){
var code = profiles[0].ToCode();
Console.WriteLine(code);
}
Once you find a working connection profile, use the generated code to quickly connect to your FTP server.
Use this code:
FtpClient client = new FtpClient(hostname, username, password); // or set Host & Credentials
client.AutoConnect();
- Auto Connection
- Auto Reconnection
- FTP(S) Connection
- FTP(S) Connection using GnuTLS
- FTPS Proxies
- Custom Servers
- Custom Commands
- v40 Migration Guide