Hi -
( my VB is mot the best ... so if response is in C# ..then i'm goosed !)
I want to write a vb app that will :
I've also seen renci .. but for some reason cant get that to work
For sharpssh - I don't want to have to enter something for sshstr.prompt .. I just ant to see the full responce..
any ideas how I could do this ?
thanks
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
( my VB is mot the best ... so if response is in C# ..then i'm goosed !)
I want to write a vb app that will :
- Connect to a device through SSH.
-
Send a list commands and wait for the response of each command, before sending the next.
I'd like each response to go to a textbox.
I've also seen renci .. but for some reason cant get that to work
For sharpssh - I don't want to have to enter something for sshstr.prompt .. I just ant to see the full responce..
any ideas how I could do this ?
thanks
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim result As String
Dim sshstr As New SshStream("10.226.145.108", "super", "super")
TextBox1.Text = "Connecting ...."
Me.Refresh()
sshstr.Prompt = "TSM"
'//Remove terminal emulation characters
sshstr.RemoveTerminalEmulationCharacters = True
TextBox1.Text = sshstr.ReadResponse()
TextBox1.Select(TextBox1.TextLength, 0)
TextBox1.ScrollToCaret()
MsgBox(" 1")
System.Threading.Thread.Sleep(5000)
Threading.Thread.Sleep(1000)
' command # 1 sshstr.Write("/c 1")
TextBox1.AppendText("/c 1")
TextBox1.Select(TextBox1.TextLength, 0)
TextBox1.ScrollToCaret()
Me.Refresh()
System.Threading.Thread.Sleep(2000)
sshstr.Prompt = ""
result = sshstr.ReadResponse()
TextBox1.AppendText(result)
TextBox1.Select(TextBox1.TextLength, 0)
TextBox1.ScrollToCaret()
Threading.Thread.Sleep(1000)
' command # 2 sshstr.Write(Chr(24))
sshstr.Write(Chr(13))
TextBox1.AppendText("Chr(24)")
TextBox1.Select(TextBox1.TextLength, 0)
TextBox1.ScrollToCaret()
Me.Refresh()
sshstr.Prompt = "TSM"
result = sshstr.ReadResponse()
TextBox1.AppendText(result)
TextBox1.Select(TextBox1.TextLength, 0)
TextBox1.ScrollToCaret()
sshstr.Close()
' //Reading from the SSH channel
End Sub