Tech Off Thread

3 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

FTP Port

Back to Forum: Tech Off
  • User profile image
    Ion Todirel

    Hey guys,

    i have a problem with FTP Classes in .NET Framework 2.0 BCL.

    This code will work if FTP server is set with default port 21, but if is not, then... will not work:

    FtpWebRequest request = WebRequest.Create(Uri) as FtpWebRequest;

    .Credentials = new
    NetworkCredential("John Todirel", "home");
    .Method = WebRequestMethods.Ftp.

    FtpWebResponse response = request.GetResponse() as FtpWebResponse;


    so how to change FTP Port? any ideas?

  • User profile image

    If the port is 2121, change the URI to be

  • User profile image
    Ion Todirel

    Maurits wrote:
    If the port is 2121, change the URI to be

    i use this:

    string uri = "";
    UriBuilder newUriPort = new UriBuilder(uri);
    newUriPort.Port = 20;
    uri = newUriPort.Uri.ToString(); //

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.