I'm trying to create an authenticated session to a remote FTP server using
the FtpWebClient class which takes a URI. Problem is, the URI doesn't seem to
accept standard ftp://username:password@server/ URIs and gives me the
following error when I try to get the propery serverUri.uri from below:
{"Invalid URI: A port was expected because of there is a colon (':') present
but the port could not be parsed."} System.FormatException
{System.UriFormatException}
Does anybody know what's going on?
UriBuilder serverUri = new UriBuilder();
serverUri.Scheme = Uri.UriSchemeFtp;
serverUri.Host = "servername.com";
serverUri.UserName = "username";
serverUri.Password = "password";
Thanks,
Leonard
Mubashir Khan - 06 Nov 2006 11:08 GMT
why dont you provide port as well ........
> I'm trying to create an authenticated session to a remote FTP server using
> the FtpWebClient class which takes a URI. Problem is, the URI doesn't seem
[quoted text clipped - 18 lines]
>
> Leonard
Leonard Chung - 06 Nov 2006 19:16 GMT
This happens with a port specified as well...
> why dont you provide port as well ........
>
[quoted text clipped - 20 lines]
> >
> > Leonard