Is there a simple, fast way to check that a FTP connection (includes host, port, username and password) is valid and working? I'm using C#. Thank you.
try something like this:
FtpWebRequest requestDir = (FtpWebRequest)FtpWebRequest.Create("ftp://ftp.google.com"); requestDir.Credentials = new NetworkCredential("username", "password"); try { WebResponse response = requestDir.GetResponse(); //set your flag } catch { }
2.1m questions
2.1m answers
60 comments
57.0k users