+1 vote

Hi, I am trying to test of using ftp.dll in VS .NET 6.0 Winform. My code is below:

using Limilabs.FTP.Client;

private void button1_Click(object sender, EventArgs e)
{
    using (Ftp client = new Ftp())
    {
        // Error here when running 
        // Limilabs.FTP.Client.FtpException: 
        // 'No such host is known.'

        client.Connect("ftp://103.77.166.26"); 

        client.Login("giamsatchung", "xxxxxxx");

        client.Upload(
            @"BVN_HOTR_NUO001.txt", 
            @"D:\SDL\Server1\2023\08\15\BVN_HOTR_NUO001.txt");

        client.Close();
    }
}
by (570 points)

1 Answer

+1 vote
 
Best answer

Do not include protocol when you connect

Remove "ftp://" and leave the ip or the server address:

client.Connect("103.77.166.26"); 

You might need to use client.ConnectSSL or client.AuthTLS() if your server requires SSL/TLS connection:

https://www.limilabs.com/blog/use-ssl-with-ftp-ftps

https://www.limilabs.com/blog/use-ssl-with-ftp-explicit

by (297k points)
selected by

Tks, it worked

...