public static void RunProcess(string FileName, string Arguments, ProcessWindowStyle WindowStyle, bool WaitforExit)
{
MessageBox.Show("Runnig the process :- File name- " + FileName.ToString() + "argumetns- " + Arguments.ToString() + "windowStyle- " + WindowStyle.ToString() + "WaitForExit- " + WaitforExit.ToString());
Process MyProcess = new Process();
MyProcess.StartInfo.FileName = FileName;
MyProcess.StartInfo.Arguments = Arguments;
MyProcess.StartInfo.WindowStyle = WindowStyle;
MyProcess.Start();
if (WaitforExit)
MyProcess.WaitForExit();
}
这里的论点也有一些空格。!!
答案 0 :(得分:0)
如果你在谈论一般的参数中的空格,那么你需要用双qoutes包装参数:
MyProcess.StartInfo.Arguments = "\"this argument has spaces\"";
因此,请确保将传递给您的方法的参数发生。