Program crashing when connecting to SSH

Oct 9, 2013 at 2:25 PM
I'm having an issue when connecting to an SSH server (using SSH and SCP). If I enter all the credentials correctly, everything works fine. However, if I enter the wrong credentials or the wrong IP (and the program can't communicate with the server), the whole program crashes. Is there a way to test a connection before trying to execute the program so that if the IP and/or the credentials are wrong, the program will alert the user instead of crashing?
Oct 9, 2013 at 3:03 PM
SshClient has an ErrorOccured-Event you can use and some other useful events.
Also try/catch can help to show Error MessageBoxes instead of crashing.

And it's always a good idea to catch all unhandled Exceptions and present them
to the user. At least in a production environment.
Oct 9, 2013 at 6:55 PM
Thanks! I included try/catch in my program and everything works great! I should use those more often lol