我制作了一个应用程序,它使用SSH连接连接到设备,就像我们使用PUTTY软件所做的那样。在我的应用程序中,我使用了Tamir.sharpSsh,C# library.It在建立SSH连接时给出了一个异常。我不知道这要么是库或设备响应的问题,要么是其他什么。
下面是代码。
using Tamir.SharpSsh;
var obj = new SshStream(ip, username, password); // exception here
obj.Write("ls -a");
string rS = obj.ReadResponse();
richTextBox.Text = rS;以下是例外情况
Exception : System.IO.IOException
at Tamir.SharpSsh.jsch.Session.connect(Int32 connectTimeout)
at Tamir.SharpSsh.jsch.Session.connect()
at Tamir.SharpSsh.SshStream..ctor(String host, String username, String password)如果需要,我还可以提供Wireshark数据。
发布于 2012-08-26 22:39:52
Tamir.SSH坏了,不能工作了。目前唯一用于.Net的开源SSH库是SSH.Det。你可以在这个链接上找到它:http://sshnet.codeplex.com/看看这个问题:Are there any good free .Net network libraries? (FTP, SFTP, SSH, etc.)
https://stackoverflow.com/questions/11683282
复制相似问题