Re: Missing wait for response in SSH.net buffer an (General questions)
Ok, I have managed to get this to work with this code below. A suggestion to the developers, that if you are setting the wait for as in a = ssh1.WaitFor( regex:[$ #>]$ , 10) then set the variable a to include the waitfor character as this is actually received in the buffer, This then will save us having to put the catch
If ssh1.DataReady > 0 Then
a = ssh1.Receive
ssh1.DataReady = 0
End If
What are peoples thoughts on this? I am now progressing. Thanks for the help.
MODIFIED CODE:
Try
ssh1.Connect()
a = ssh1.WaitFor( Password: , 10)
TextBox1.Text = TextBox1.Text & a
ssh1.Send( cisco + vbLf)
a = ssh1.WaitFor( regex:[$ #>]$ , 10)
TextBox1.Text = TextBox1.Text & a
If ssh1.DataReady > 0 Then
a = ssh1.Receive
TextBox1.Text = TextBox1.Text & a
ssh1.DataReady = 0
End If
ssh1.Send( sho env + vbLf)
a = ssh1.WaitFor( regex:[$ #>]$ , 10)
TextBox1.Text = TextBox1.Text & a
If ssh1.DataReady > 0 Then
a = ssh1.Receive
TextBox1.Text = TextBox1.Text & a
ssh1.DataReady = 0
End If
ssh1.Send( sho int desc + vbLf)
a = ssh1.WaitFor( regex:[$ #>]$ , 10)
TextBox1.Text = TextBox1.Text & a
If ssh1.DataReady > 0 Then
a = ssh1.Receive
TextBox1.Text = TextBox1.Text & a
ssh1.DataReady = 0
End If
MsgBox( done )
Catch ex As Exception
MsgBox( Exception & ex.Message)
End Try
Complete thread:
- Missing wait for response in SSH.net buffer and mi - Simon, 2009-04-23, 14:07
- Re: Missing wait for response in SSH.net buffer an - wodDamir, 2009-04-23, 14:16
- Re: Missing wait for response in SSH.net buffer an - Simon, 2009-04-23, 14:26
- Re: Missing wait for response in SSH.net buffer an - wodDamir, 2009-04-23, 14:36
- Re: Missing wait for response in SSH.net buffer an - Sunny, 2009-04-23, 16:48
- Re: Missing wait for response in SSH.net buffer an - woddrazen, 2009-04-23, 17:11
- Re: Missing wait for response in SSH.net buffer an - Sunny, 2009-04-23, 17:18
- Re: Missing wait for response in SSH.net buffer an - woddrazen, 2009-04-23, 18:48
- Re: Missing wait for response in SSH.net buffer an - Simon, 2009-04-24, 10:40
- Re: Missing wait for response in SSH.net buffer an - woddrazen, 2009-04-23, 18:48
- Re: Missing wait for response in SSH.net buffer an - Sunny, 2009-04-23, 17:18
- Re: Missing wait for response in SSH.net buffer an - woddrazen, 2009-04-23, 17:11
- Re: Missing wait for response in SSH.net buffer an - Sunny, 2009-04-23, 16:48
- Re: Missing wait for response in SSH.net buffer an - wodDamir, 2009-04-23, 14:36
- Re: Missing wait for response in SSH.net buffer an - Simon, 2009-04-23, 14:26
- Re: Missing wait for response in SSH.net buffer an - wodDamir, 2009-04-23, 14:16