控制臺程序的未處理異常我已經用AppDomain.CurrentDomain.UnhandledException捕獲了,為什么程序還會停止
6 回答

精慕HU
TA貢獻1845條經驗 獲得超8個贊
這樣的:
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
?
??????? private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)??????? {??????????? Exception error = (Exception)e.ExceptionObject;??????????? Console.WriteLine("MyHandler caught : " + error.Message);??????? }
- 6 回答
- 0 關注
- 530 瀏覽
添加回答
舉報
0/150
提交
取消