【发布时间】:2017-12-26 02:11:20
【问题描述】:
我无法理解为什么我的 C# process.start 不起作用。下面列出了代码,并且我已验证 msg.exe 位于 C:\Windows\System32\ 文件夹中。我可以很好地使用批处理文件中的命令,也可以使用命令行。由于某种原因,我无法让它在我的 C# 代码中工作。我确实添加了“使用 System.Diagnostics”,这是 Windows 10 Pro。错误是“系统找不到指定的文件”。任何帮助都会很棒。谢谢!
private void btnSend_Click(object sender, EventArgs e)
{
string mypath = @"C:\Windows\System32\";
Process.Start(@mypath + "msg.exe " + " * /time:20 hello there");
}
我也用过这个,但是也没用:
private void btnSend_Click(object sender, EventArgs e)
{
Process.Start(@"C:\Windows\System32\msg.exe * /time:20 hello there");
}
【问题讨论】:
-
Process.start with 2 args...second 是命令行参数
标签: c# process.start