Page 1 of 1

verifying valid connection

Posted: Thu Feb 27, 2014 1:31 am
by RBygrave
so we had the recieving connecion change the passoerd on on us and the app just crashed with no explatination in the com exception. how do we confirm at connection time that the connection was sucessful. I need to trap this specific error.

Re: verifying valid connection

Posted: Thu Feb 27, 2014 4:15 pm
by RBygrave
Here is a suggestion for the next release the .Connect() should return bool as a quick test so you could use it like this
if(!sftp..Connect()) do something as I didn't connect
Just a thought.

Re: verifying valid connection

Posted: Thu Feb 27, 2014 4:26 pm
by RBygrave
So is this the right way to check connection status after a connect
_ftp.Connect();
if (_ftp.ConnectionStatus == ConnectionStatus.ftpConnectionStatusConnected)isConnected = true

_sftp.Connect();
if (_sftp.LastStatusCode == enumSFTPStatus.ftpSFTPStatusOk) isConnected = true;