Setting port in FtpWebRequest

Chris picture Chris · Oct 26, 2010 · Viewed 14.8k times · Source

I need the user to be able to be able to modify the port for downloading FTP information - but I can't find a way of changing this in FtpWebRequest.

Answer

Dismissile picture Dismissile · Oct 26, 2010

Isn't the port just part of the URI used to create the web request?

FtpWebRequest request = (FtpWebRequest)WebRequest.Create("ftp://10.0.0.1:12345");