private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) { string str = LoggerUtils.GetExceptionMsg(e.ExceptionObject as Exception, e.ToString()); MessageBox.Show(str, "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Error); LoggerUtils.Error(str); }
private static void Application_ThreadException(object sender, ThreadExceptionEventArgs e) { string str = LoggerUtils.GetExceptionMsg(e.Exception, e.ToString()); MessageBox.Show(str, "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Error); LoggerUtils.Error(str); }