您好,我通过sharpssh连接到 Unix 服务器:
Imports Tamir.SharpSsh
Imports Tamir.Streams
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim ssh As SshExec
ssh = New SshExec("********", "******", "*****")
ssh.Connect()
ssh.RunCommand("amos RNC111")
ssh.RunCommand("lt all")
ssh.RunCommand("bye")
ssh.Close()
End Sub
End Class
问题是在ssh.Connect()
我必须连接到 RNC(无线电网络控制器)并等待它连接之后。我不知道如何处理它,我检查通过重定向标准输入来做到这一点,但我发现创建一个新进程:
myProcess.StartInfo.FileName = "pepe.exe"
myProcess.StartInfo.UseShellExecute = False
myProcess.StartInfo.RedirectStandardInput = True
myProcess.Start()
Dim ssh As SshExec
ssh = New SshExec("********", "******", "*****")
ssh.Connect()
ssh.RunCommand("amos RNC111")
MsgBox(myProcess.StandardInput)
ssh.Close()
但我不工作。