Quantcast
Channel: .NET Framework Class Libraries forum
Viewing all articles
Browse latest Browse all 8156

WebRequest FTP

$
0
0

FtpWebRequest request = (FtpWebRequest)WebRequest.Create("ftp://MyFTPServer.tld");
request.Credentials = new NetworkCredential(user, password);
request.Method = WebRequestMethods.Ftp.ListDirectoryDetails;
FtpWebResponse response = (FtpWebResponse)request.GetResponse();

throws a System.Net.WebException (Unable to connect to the remote server) after 20 sec. if server is not running.
The mentioned exception is documented as something about EnableSsl and server not supporting this, but the behaviour is more like a timeout (which is natural of course, server is not running), how to control this timeout?



Viewing all articles
Browse latest Browse all 8156

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>