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.
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
/*Hola Este es el metodo que utilizo si conoces uno mejor hasmelo saber Ubirajara 100% Mexicano isc.erthal@gmail.com */
try something like this:
Use either System.Net.FtpWebRequest or System.Net.WebRequestMethods.Ftp to test your connection using your login credentials. If the FTP request fails for whatever reason the appropriate error message will be returned indicating what the problem was (authentication, unable to connect, etc...)
You could try using
System.Net.FtpWebRequest
and then just check theGetResponseStream
method.So something like
This is from the msdn site to diplay files from a server