程序挂在 .RunCommand() 处。我错过了一些非常基本的东西吗?似乎这是对其他人有效的相同代码,我知道该命令是正确的。
如果我注释掉 .runcommand() 程序执行没有错误。
static void Main(string[] args)
{
PrivateKeyFile key = new PrivateKeyFile("private");
using (var client = new SshClient("host", "user", key))
{
client.Connect();
client.RunCommand("command");
client.Disconnect();
}
}
我感谢任何高级帮助。