verifying valid connection

This forum is not monitored by the SmartFTP staff. If you have a license please contact technical support by email.
Post Reply
RBygrave
Posts: 24
Joined: Mon Jan 14, 2008 8:36 pm

verifying valid connection

Post by RBygrave » Thu Feb 27, 2014 1:31 am

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.

RBygrave
Posts: 24
Joined: Mon Jan 14, 2008 8:36 pm

Re: verifying valid connection

Post by RBygrave » Thu Feb 27, 2014 4:15 pm

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.

RBygrave
Posts: 24
Joined: Mon Jan 14, 2008 8:36 pm

Re: verifying valid connection

Post by RBygrave » Thu Feb 27, 2014 4:26 pm

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;

Post Reply