Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
2.2k views
in .NET FTP by (620 points)
Every couple of days I get this error when I try to connect to an ftp site. This causes the error to go to screen and user intervention is required. I am trying to automate this connection. Is there a way to catch this exception so that it does not go to the screen?

System.IO.IOException: Unable to read data from the transport connection. ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
:?:

1 Answer

0 votes
by (51.6k points)
Is there a way to catch this exception so that it does not go to the screen?


You should be able to catch this exception by simply putting a try-catch around your FTP code. You may also like to have a look at AppDomain.CurrentDomain.UnhandledException which permits you to provide a sort of global catch-all.

- Hans (EDT)

Categories

...