Process process = new Process
{
StartInfo = { FileName = "cmd.exe", UseShellExecute = false, RedirectStandardInput = true, RedirectStandardOutput = true, RedirectStandardError = true, CreateNoWindow = true }
};
process.Start();
process.StandardInput.WriteLine("mstsc /v:101.112.119.156 /f");
process.Close();
如果想使用其他命令只需要替换WriteLine中的字符串即可。
C#调用CMD命令
最新推荐文章于 2023-02-12 16:02:43 发布