我认为C#进程类在接受<
或>
字符作为参数传递时遇到问题。C#进程不接受我的参数
当我调用以下代码时,可执行文件返回一个错误,指示我传递了多个参数。
proc = new Process();
proc.StartInfo.FileName = this.spumux.SpumuxExe;
proc.StartInfo.Arguments = "menu.xml <menu.mpg> newmenu.mpg";
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.CreateNoWindow = true;
proc.StartInfo.RedirectStandardOutput = true;
proc.StartInfo.RedirectStandardError = true;
proc.EnableRaisingEvents = true;
proc.OutputDataReceived += new DataReceivedEventHandler(OutputHandler);
proc.ErrorDataReceived += new DataReceivedEventHandler(OutputHandler);
proc.Exited += new EventHandler(ProcExited);
proc.Start();
proc.BeginOutputReadLine();
proc.BeginErrorReadLine();
此代码通常与我尝试过的其他所有可执行文件一起工作,没有任何问题。所以它必须做些什么与<
,>
字符
任何想法?
当然没问题。 – 2011-01-24 17:06:57