I would like to connect to a FTP-Server which works in the 'active-mode'. This means, the client can send the port number, on which the data-connection should be done. Usually this is a random port. (N > 1023)
In our case, it would be really nice, if we could always use a specific port for the connection to the FTP-Server. Something like '8232'.
Is this possible?
This is my code:
FtpWebRequest.DefaultWebProxy = null;
FtpWebRequest ftpWebRequest = (FtpWebRequest)FtpWebRequest.Create(new Uri("ftp://" + "OurDomainOfTheFTP" + "/"));
ftpWebRequest.Credentials = new NetworkCredential(this.benutzer, this.passwort);
ftpWebRequest.Timeout = 5000;
ftpWebRequest.UsePassive = false;
ftpWebRequest.Method = WebRequestMethods.Ftp.ListDirectory;
WebResponse webResponse = ftpWebRequest.GetResponse();
webResponse.Close();
Can i just write something like that?
FtpWebRequest ftpWebRequest = (FtpWebRequest)FtpWebRequest.Create(new Uri("ftp://" + "OurDomainOfTheFTP" + ":8232/"));