Tôi đang tạo quy trình với đối tượng System.Diagnostics.Process
đôi khi gặp sự cố và Windows sẽ đặt hộp thoại Gửi Báo cáo Lỗi. Tôi không có quyền kiểm soát quá trình con, nhưng tôi đã xử lý các trường hợp khi nó bị treo, làm cách nào để ngăn hộp thoại bật lên?Làm cách nào để ngăn chặn hộp thoại Báo cáo Lỗi của Microsoft khi một quá trình con bị treo
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();
Điều này thật không may, nhưng nó đáng được hỏi. –
[Thiết lập WER] (http://msdn.microsoft.com/en-us/library/bb513638%28VS.85%29.aspx) cũng liệt kê một số khoá đăng ký, đặc biệt là 'DontShowUI'. –