[英]Program Execution + Parameters from a form in C#
我目前正在尝试使用 C# 形式的参数执行程序。 我的代码:
private void button1_Click_1(object sender, EventArgs e)
{
Process.Start("nan.exe");
}
虽然我试图传递这个参数:“nan.exe C:\Windows\System32”
在我的情况下,我怎么能这样做?
利用:
Process.Start("nan.exe", @"c:\windows\system32");
建议使用 Environment.GetFolderPath()。
您可以使用StartInfo
object 为您执行此操作:
// where fileName and arguments is what you need:
Process p = new Process();
p.StartInfo = new ProcessStartInfo(@"nan.exe", @"C:\windows\system32");
p.Start();
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.