Exception When子句在很大程度上未知。
考虑这个:
Public Sub Login(host as string,user as String,password as string,_ Optional bRetry as Boolean = False) Try ssh.Connect(host,user,password) Catch ex as TimeoutException When Not bRetry ''//Try again,but only once. Login(host,password,True) Catch ex as TimeoutException ''//Log exception End Try End Sub