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 { }
1.4m articles
1.4m replys
5 comments
57.0k users