mar*_*234 3 c# ssh c#-4.0 ssh.net
我目前正试图通过C#使用SSH命令与路由器"对话".
我正在使用SSH.net模型.
public void connectSSH(string hostName, string username, string password)
{
using (var client = new SshClient(hostName, username, password))
{
client.Connect();
client.RunCommand(CommandList.showEnvironment());
client.Disconnect();
}
}
Run Code Online (Sandbox Code Playgroud)
这是我到目前为止的代码(所有命令都在另一个文件中).理想情况下,我能够捕获路由器对命令的响应,而不仅仅是单向传递和执行命令.
我如何捕获响应?例如; 命令"show environment"以一系列因子作出响应
单位温度描述/ ID电流/阈值范围
1中心温度/ 1 27C/11~79C状态代码:*温度超出阈值范围细节风扇
| 归档时间: |
|
| 查看次数: |
671 次 |
| 最近记录: |