【发布时间】:2010-12-21 13:33:06
【问题描述】:
我有一个流程对象设置如下:
Process p = new Process();
p.StartInfo.FileName = command;
p.StartInfo.UseShellExecute = true;
p.StartInfo.Arguments = String.Format(
commandArguments,
destinationLocation,
sourceLocation,
sourceDirName,
(string.IsNullOrEmpty(revisionNotes.Text)) ? "" : revisionNotes.Text);
(其中未定义的值在此代码外部提供并且有效)。有问题的进程启动并使用p.Start(); 正确执行,但我需要在终止时捕获它。控制台窗口短暂闪烁并消失,这似乎表明该过程已完成,但没有触发任何相关事件(OutputDataRecieved、Exited 等),就像该过程永远不会结束。 (如果相关,我正在尝试使用一些参数执行 lua 脚本)。有人可以帮我让这个过程正确停止吗?
【问题讨论】: