Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
75 views
asked in .NET FTP by (120 points)
I have a .NET application that uses edtFTPnet/PRO to round-robin check a number of different FTP servers, search for files, and if any are found meeting certain criteria, download the files to a local folder.

The app is controlled by information that is entered into a database table by a human.

The human sometimes enters information incorrectly, such as perhaps misspelling a hostname.  When this happens, the SecureFTPConnection's Connect() method fails and raises a ControlChannelIOException with the message "An I/O exception occurred.".

Is there any way to programmatically determine more precisely what the issue is, such as DNS name resolution error?

Thanks!

1 Answer

0 votes
answered by (2.7k points)

There are a few different scenarios:

Exception Cause
FormatException The user supplies something that looks like an IP address, but which is invalid (e.g. 299.0.0.0).
ArgumentOutOfRangeException Hostname is longer than 255 characters.
SocketException Error while connecting to DNS server or to target server
ArgumentException Hostname could not be resolved
ControlChannelIOException Error while communicating with server (after connection)
SSHAuthenticationException SFTP/SCP authentication failed
FTPAuthenticationException FTP/FTPS authentication failed

 

Categories

...