プログラムのエントリでは、次のコードを追加します。
AppDomain.CurrentDomain.UnhandledException + = 新しい UnhandledExceptionEventHandler(CurrentDomain_UnhandledException)。
後ろのメソッドを追加します。
プライベート 静的 ボイド CurrentDomain_UnhandledException(オブジェクト送信者、UnhandledExceptionEventArgs E) { Console.WriteLineを(e.ExceptionObject.ToString())。 MessageBox.Show(e.ExceptionObject.ToString())。 }