Dart.Ssh Namespace > SshConnection Class : StateChanged Event |
'Declaration Public Event StateChanged As EventHandler
'Usage Dim instance As SshConnection Dim handler As EventHandler AddHandler instance.StateChanged, handler
public event EventHandler StateChanged
public: __event EventHandler* StateChanged
public: event EventHandler^ StateChanged
Connection.GetRemainingAuthMethods can raise this event if its return value is not cached from a previous authentication attempt.
This method is raised on the UI thread if the SynchronizingObject is set. Otherwise this event is raised on a worker thread.
private void ssh1_StateChanged(object sender, BaseEventArgs e) { if (ssh1.State == ConnectionState.Closed) this.Text = "Not Connected"; else if (ssh1.State == ConnectionState.Connected) this.Text = "Connected to " + ssh1.Connection.RemoteEndPoint.ToString(); else if (ssh1.State == ConnectionState.ConnectedAndPartiallyAuthenticated) this.Text = "Partially Authenticated..."; else this.Text = "Securely connected to " + ssh1.Connection.RemoteEndPoint.ToString(); }
Private Sub ssh1_StateChanged(ByVal sender As Object, ByVal e As BaseEventArgs) Handles ssh1.StateChanged If ssh1.State = ConnectionState.Closed Then Me.Text = "Not Connected" ElseIf ssh1.State = ConnectionState.Connected Then Me.Text = "Connected to " & ssh1.Connection.RemoteEndPoint.ToString() ElseIf ssh1.State = ConnectionState.ConnectedAndPartiallyAuthenticated Then Me.Text = "Partially Authenticated..." Else Me.Text = "Securely connected to " & ssh1.Connection.RemoteEndPoint.ToString() End If End Sub