Sorry - the code should have read:
FtpWebRequest request =
(FtpWebRequest)WebRequest.Create("ftp://192.168.80.114:21/");
request.Method = WebRequestMethods.Ftp.ListDirectory;
request.UsePassive = false;
request.Credentials = new NetworkCredential("guest",null);
request.Proxy = null;
FtpWebResponse response =
(FtpWebResponse)request.GetResponse();
response.Close();
and I still get the same problem. I was trying all sorts of things out and
forgot to set the port number back to 21
--
Ian H
"Peter Bromberg [C# MVP]" wrote:
ftp://integration300 uses the default port (21) but your code is attempting
to use port 20. Apparently there is nothing listening to port 20, so there
you go.
Pete
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com
"Ian Hannah" wrote:
I am running the following code (using VS 2005) with the appropriate
username and password and the request always timeouts:
FtpWebRequest request =
(FtpWebRequest)WebRequest.Create("ftp://integration300:20/");
request.Method = WebRequestMethods.Ftp.ListDirectory;
request.UsePassive = false;
request.Credentials = new
NetworkCredential(<user>,<password>);
request.Proxy = null;
FtpWebResponse response =
(FtpWebResponse)request.GetResponse();
response.Close();
If I perform the query "ftp://integration300" in IE then I can see all the
available drives as expected. I can also access the drives by calling "ftp
integration300" at a command prompt and typing in the user name and password.
Does anyone know why the query may be timing out?
--
Ian H