0

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.

Mahdi
  • 3,199
  • 2
  • 25
  • 35
MovGP0
  • 7,267
  • 3
  • 49
  • 42

1 Answers1

0

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);
    }
}

MovGP0
  • 7,267
  • 3
  • 49
  • 42