- Использование RunCommand
Код: Выделить всё
using (var duclient = new SshClient("ipaddress", 22, "admin", "admin")){ duclient.Connect(); string poweroff = duclient.RunCommand("show outlets").Result; Console.WriteLine(poweroff); duclient.Disconnect(); duclient.Dispose(); } - Использование CreateCommand и Execute
Код: Выделить всё
using (var duclient = new SshClient("ipaddress", 22, "admin", "admin")){
duclient.Connect();
SshCommand command = duclient.CreateCommand("show outlets");
command.Execute();
duclient.Disconnect();
duclient.Dispose();
}
Подробнее здесь: https://stackoverflow.com/questions/786 ... -using-put

