G
Guest
Hi all,
I wrote simple FTP client class (using MSDN "template"). It works ok on my
computer, but connection to one server raises this error:
The server returned an address in response to the PASV command that is
different than the address to which the FTP connection was made.
When I set UsePassive to false, another exception throws, but with the same
meaning. I tried IP address to, but with no success.
Does anybody know, what's wrong?
the code is:
FtpWebRequest request = (FtpWebRequest)FtpWebRequest.Create(server);
request.Method = WebRequestMethods.Ftp.ListDirectory;
request.Credentials = new NetworkCredential(userName, password);
//request.UsePassive = false;
FtpWebResponse response = (FtpWebResponse)request.GetResponse();
I wrote simple FTP client class (using MSDN "template"). It works ok on my
computer, but connection to one server raises this error:
The server returned an address in response to the PASV command that is
different than the address to which the FTP connection was made.
When I set UsePassive to false, another exception throws, but with the same
meaning. I tried IP address to, but with no success.
Does anybody know, what's wrong?
the code is:
FtpWebRequest request = (FtpWebRequest)FtpWebRequest.Create(server);
request.Method = WebRequestMethods.Ftp.ListDirectory;
request.Credentials = new NetworkCredential(userName, password);
//request.UsePassive = false;
FtpWebResponse response = (FtpWebResponse)request.GetResponse();