Home Forums .NET libraries Xceed SFTP/FTP for .NET An Unexpected Error While resolving the server hostname

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #20689 |

    Hi,

    I’ve just download Xceed http://FTP.Net 2.0. I’m testing out the functionalities of this component, and keep getting the following error

    “An Unexpected error occurred while resolving the server hostname”

    Below is the code:

    using Xceed.Ftp;

    public void Test()
    {

    try
    {
    Xceed.Ftp.Licenser.LicenseKey = “FTN20-A4TUJ-NANJD-E45A”;
    Xceed.Ftp.FtpClient ftp = new FtpClient();
    http://ftp.PassiveTransfer = true;

    http://ftp.Connect(“172.24.57.163”);
    http://ftp.Login(“*****”, “*****”);
    http://ftp.SendMultipleFiles(“T:/ALS/Output/102”, false, false);
    Console.WriteLine(“Complete”);

    }
    catch(Exception e)
    {
    Console.WriteLine(e.Message);
    }

    I’m able to connect to this server using ftp command at dos prompt.

    Please let me know what I’m doing wrong.

    Thanks,
    Huy

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by Tranh2 (had 2503 views)

    User (Old forums)
    Member
    Post count: 23064

    Hi!

    Normally, specifying a dotted string address should work. It works on my machine. Maybe under special conditions, it doesn’t.

    A workaround is to use the Connect overload that takes an IPEndPoint instead of a string, like this:

    // Assuming “using System.Net”
    http://ftp.Connect( new IPEndPoint( IPAddress.Parse( “172.24.57.163” ), 21 ) );

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by Martin (had 3225 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.