9
我正在使用System.Diagnostics.Process
對象創建進程,該對象有時會崩潰並且Windows會提供「發送錯誤報告」對話框。我無法控制子進程,但我已經在處理崩潰的情況,如何防止彈出對話框?如何在子進程崩潰時禁止Microsoft錯誤報告對話框
Process p = new Process();
p.StartInfo.FileName = Path.Combine(avokeHome, @"bin\folderstx.exe");
p.StartInfo.Arguments = "-f" + propertiesFile;
p.StartInfo.CreateNoWindow = true;
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.RedirectStandardOutput = true;
p.OutputDataReceived += (sender, e) => { if(!string.IsNullOrEmpty(e.Data)) Console.WriteLine(e.Data); };
p.ErrorDataReceived += (sender, e) => { if(!string.IsNullOrEmpty(e.Data)) Console.WriteLine(e.Data); };
p.EnableRaisingEvents = true;
p.Exited += (sender, e) => { Console.WriteLine("Exited"); };
p.Start();
p.BeginErrorReadLine();
p.BeginOutputReadLine();
這是不幸的,但它值得問。 – 2010-08-11 19:10:41
[WER Settings](http://msdn.microsoft.com/zh-cn/library/bb513638%28VS.85%29.aspx)也列出了一些註冊表項,特別是'DontShowUI'。 – 2010-09-03 16:22:52