public static void UnhandledExceptionHandler(object sender, System.Threading.ThreadExceptionEventArgs e) { try { // Create Error Message string message = string.Format("An Application Error has occurred.\r\n\r\nEXCEPTION:\r\nSource: {0}\r\nMessage: {1}\r\n", e.Exception.Source, e.Exception.Message); if (e.Exception.InnerException != null) { message += string.Format("\r\nINNER EXCEPTION:\r\nSource: {0}\r\nMessage: {1}\r\n", e.Exception.InnerException.Source, e.Exception.InnerException.Message); } message += string.Format("\r\nSTACK TRACE:\r\n{0}", e.Exception.StackTrace); SendErrorMessage(message); frmShowError fshow = new frmShowError(); fshow.settype(message); fshow.ShowDialog(); Environment.Exit(0); } catch { Environment.Exit(0); } }
public static void UnhandledExceptionHandler(Exception e) { try { // Create Error Message string message = string.Format("An Application Error has occurred.\r\n\r\nEXCEPTION:\r\nSource: {0}\r\nMessage: {1}\r\n", e.Source, e.Message); if (e.InnerException != null) { message += string.Format("\r\nINNER EXCEPTION:\r\nSource: {0}\r\nMessage: {1}\r\n", e.InnerException.Source, e.InnerException.Message); } message += string.Format("\r\nSTACK TRACE:\r\n{0}", e.StackTrace); SendErrorMessage(message); frmShowError fshow = new frmShowError(); fshow.settype(message); fshow.ShowDialog(); } catch { } }
public static void UnhandledExceptionHandler(string e1) { try { // Create Error Message string message = string.Format("An Application Error has occurred.\r\n\r\nEXCEPTION:\r\nMessage:"); message += e1 + "\r\n"; message += string.Format("\r\nSTACK TRACE:\r\n{0}", Environment.StackTrace); SendErrorMessage(message); frmShowError fshow = new frmShowError(); fshow.settype(message); fshow.ShowDialog(); Environment.Exit(0); } catch { Environment.Exit(0); } }