使用 SharpSsh 连接SSH 出现的问题请大家帮忙看看
Imports Tamir
Imports Tamir.SharpSsh
Imports Tamir.SharpSsh.jsch
Imports Tamir.Streams
Public Class Form1
Dim myshell2 As SshStream
Dim pattern As String
Dim res As String
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
myshell2.Write(TextBox2.Text & vbCrLf)
res = ""
While (True)
If res.ToLower().Equals("$") Then
Exit While
End If
res = myshell2.ReadResponse
TextBox1.Text = res
End While
TextBox2.Text = ""
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
myshell2 = New SshStream("192.168.221.108", "root", "pasd")
End Sub
End Class
res = myshell2.ReadResponse 这里会报错
索引超出范围。必须为非负值并小于集合大小。
要不然就是死循环跳不出来~
补充:.NET技术 , VB.NET