User1352128867 posted
I'm working on some legacy code that has no comments at all, but here are the circumstances. I need to connect to a network scanner and access a particular folder. The username and password are set up. Here is what was given to me:
FtpWebRequest ftp = (FtpWebRequest)WebRequest.Create(navigate);
ftp.Method = WebRequestMethods.Ftp.ListDirectoryDetails;
ftp.Credentials = new NetworkCredential(ConfigurationManager.AppSettings["hpUser"], ConfigurationManager.AppSettings["hpPwd"]);
FtpWebResponse resp = (FtpWebResponse)ftp.GetResponse();
Stream respStream = resp.GetResponseStream();
StreamReader rdr = new StreamReader(respStream);
Now, its timing out at the StreamReader.
The 'navigate' variable is the IP of the scanner.
My assumption is that it is trying to ftp to a scanner, and therefore gets locked up. I'm not sure if the connection is actually done, but when debugging, it steps to the StreamReader before timing out.
Does anyone have any leads on where I can take this to make it work?
Thank you.