我想了解如何Ssh.NET能告诉我,如果连接成功建立:如何检查Ssh.NET连接是否成功建立?
SshClient client = new SshClient("127.0.0.1", 22, "root", "");
client.Connect();
// Connection ok? Then continue, else display error
SshCommand x = client.RunCommand("service apache2 status");
client.Disconnect();
client.Dispose();
而且我怎么证明的结果“client.RunCommand(”服务的Apache2状态“); “逻辑?
例如如果(X == “的Apache2运行”)
谢谢:-)有时你可以没有看到树木的森林。 – udgru 2015-03-02 15:23:29