Dart.Ssh Namespace > SshConnection Class : Banner Event |
'Declaration Public Event Banner As SshConnection.BannerEventHandler
'Usage Dim instance As SshConnection Dim handler As SshConnection.BannerEventHandler AddHandler instance.Banner, handler
public event SshConnection.BannerEventHandler Banner
public: __event SshConnection.BannerEventHandler* Banner
public: event SshConnection.BannerEventHandler^ Banner
The event handler receives an argument of type BannerEventArgs containing data related to this event. The following BannerEventArgs properties provide information specific to this event.
Property | Description |
---|---|
Accept | Set to false to refuse the banner and cancel authentication. Defaults to true. |
BannerText | Gets the text of the banner sent by the server. |
private void ssh1_Banner(object sender, BannerEventArgs e) { string prompt = string.Concat(e.BannerText.Trim(), Environment.NewLine, Environment.NewLine, "Continue with authentication?"); if (MessageBox.Show(prompt, "Server presented a banner", MessageBoxButtons.YesNo) == DialogResult.No) { //Set to false to cancel Authentication e.Accept = false; } }
Private Sub ssh1_Banner(ByVal sender As Object, ByVal e As BannerEventArgs) Handles ssh1.Banner Dim prompt As String = String.Concat(e.BannerText.Trim(), Environment.NewLine, Environment.NewLine, "Continue with authentication?") If MessageBox.Show(prompt, "Server presented a banner", MessageBoxButtons.YesNo) = System.Windows.Forms.DialogResult.No Then 'Set to false to cancel Authentication e.Accept = False End If End Sub