我想知道 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("service apache2 status");”的结果 逻辑上?
例如 if(x == "apache2 正在运行")