在C#中使用PuTTY运行Unix命令 [英] Run Unix commands using PuTTY in C#

查看:167
本文介绍了在C#中使用PuTTY运行Unix命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用C#在PuTTY中运行Unix命令.我有下面的代码.但是代码不起作用.我无法打开腻子.

I am trying to run Unix commands in PuTTY using C#. I have the below code. But the code is not working. I am not able to open PuTTY.

static void Main(string[] args)
{
    Process cmd = new Process();
    cmd.StartInfo.FileName = @"C:\Windows\System32\cmd";
    cmd.StartInfo.UseShellExecute = false;
    cmd.StartInfo.RedirectStandardInput = false;
    cmd.StartInfo.RedirectStandardOutput = true;
    cmd.Start();
    cmd.StartInfo.Arguments = "C:\Users\win7\Desktop\putty.exe -ssh mahi@192.168.37.129 22 -pw mahi";
}

推荐答案

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆