ftp - Invalid Uri: invalid port specified C# -
i created ftp server locally filezilla server. admin port 14147 default. filezilla client got connected no problems.
when try connect chrome or ie
ftp://(ip)
or
ftp://(full machine name)
or
ftp://(user:password)@(machine).
everything ok.
my admin interface setting port 14147. listing port default 21
no problems @ internet browsers telnet.
now created application in c# , when use uri class
uri target = new uri(struri);
i got exception error: invalid uri: invalid port specified
i saved ftp address in database , tried many variations nothing happens:
ftp://user:password@fullmachinenamewithdomain ftp://user:password@fullmachinenamewithdomain:21 ftp://user:password@fullmachinenamewithdomain:14147
what doing wrong?
afaik username , password not supposed part of url. should pass them separately credentials when you're using ftpwebrequest class. e.g.
request.credentials = new networkcredential(username, password);
Comments
Post a Comment