I want to create an FTP or FTPS connection with LINQPad to an FTP/FTPS Server.
I do have the servername and the user credentials.
You can install the FluentFTP nuget package and import the following namespaces:
FluentFTP
System.Net
using (var client = new FtpClient("SERVERNAME"))
{
client.Port = 990;
client.EncryptionMode = FtpEncryptionMode.Implicit;
client.Credentials = new NetworkCredential(@"USERNAME", @"PASSWORD");
using (var cts = new CancellationTokenSource(TimeSpan.FromMinutes(5)))
{
await client.ConnectAsync(cts.Token);
client.GetListing("/").Dump();
await client.DisconnectAsync(cts.Token);
}
}