当前位置: 首页>>代码示例>>C#>>正文


C# UnhandledExceptionEventArgs.ToString方法代码示例

本文整理汇总了C#中System.UnhandledExceptionEventArgs.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# UnhandledExceptionEventArgs.ToString方法的具体用法?C# UnhandledExceptionEventArgs.ToString怎么用?C# UnhandledExceptionEventArgs.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.UnhandledExceptionEventArgs的用法示例。


在下文中一共展示了UnhandledExceptionEventArgs.ToString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CurrentDomain_UnhandledException

        private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
        {
            Console.WriteLine(e.ToString());
            _Log.Fatal(e.ToString());

            Console.ReadLine();
        }
开发者ID:ittray,项目名称:LocalDemo,代码行数:7,代码来源:Program.cs

示例2: AppDomainUnhandledException

 /// <summary>
 /// </summary>
 /// <param name="sender"> </param>
 /// <param name="e"> </param>
 protected virtual void AppDomainUnhandledException(object sender, UnhandledExceptionEventArgs e)
 {
     #if !DEBUG
     Trace.WriteLine(e.ToString());
     #else
     Debug.WriteLine(e.ToString());
     #endif
 }
开发者ID:jaypatrick,项目名称:dica,代码行数:12,代码来源:BaseForm.cs

示例3: CurrentDomain_UnhandledException

 public void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
 {
     if (e.IsTerminating)
     {
         Fatal("Application Fatal!", new Exception(string.Format("Exception Object:{0} UnhandledExceptionEventArgs:{1}",e.ExceptionObject.ToString(),e.ToString())));
     }
     else
     {
         Error("Application Error!", new Exception(string.Format("Exception Object:{0} UnhandledExceptionEventArgs:{1}", e.ExceptionObject.ToString(), e.ToString())));
     }
 }
开发者ID:priceLiu,项目名称:Enterprise.Company,代码行数:11,代码来源:Log4NetUtil.cs

示例4: CurrentDomain_UnhandledException

 private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
 {
     string str = GetExceptionMsg(e.ExceptionObject as Exception, e.ToString());
     Loger.Error(str);
     //MessageBox.Show(str, "系统错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
     //LogManager.WriteLog(str);
 }
开发者ID:safawo,项目名称:Dev.ProcessMonitor,代码行数:7,代码来源:Program.cs

示例5: CurrentDomainUnhandledException

 private static void CurrentDomainUnhandledException(object sender, UnhandledExceptionEventArgs e)
 {
     if (!(e.ExceptionObject is ThreadAbortException))
     {
         System.Diagnostics.EventLog.WriteEntry("low-level-sendkeys", "Unhandled Exception at socket-server: " + e.ToString());
     }
 }
开发者ID:thitiboy,项目名称:low-level-sendkeys,代码行数:7,代码来源:SocketConnection.cs

示例6: UnhandledException

        static void UnhandledException(object sender, UnhandledExceptionEventArgs exception)
        {
            string logfile = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase) + "\\logfile.txt";

            StreamWriter writer = new StreamWriter(logfile, true);
            writer.WriteLine(DateTime.Now.ToString() + " Main Application Bombed - " + exception.ToString());
            writer.Close();
        }
开发者ID:TechnoSwiss,项目名称:Uniden_Remote_Head,代码行数:8,代码来源:Program.cs

示例7: CurrentDomain_UnhandledException

        static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
        {
            string str = GetExceptionMsg(e.ExceptionObject as Exception, e.ToString());
            //MessageBox.Show(str, "系统错误", MessageBoxButtons.OK, MessageBoxIcon.Error);

            if (_sendErrorEmail)
                UserUtils.SendEmail("错误日志", str);
            //LogManager.WriteLog(str);
            log.Error(str);
        }
开发者ID:kinpauln,项目名称:FreightForwarder,代码行数:10,代码来源:Program.cs

示例8: UnhandledExceptionEventHandler

        static void UnhandledExceptionEventHandler(object sender, UnhandledExceptionEventArgs e)
        {
            try
            {
                ComForm.InsertErrLog("ExceptionObject" + e.ExceptionObject + "," + e.ToString(), "ERROR");
            }
            catch
            {

            }
        }
开发者ID:gaoge00,项目名称:TianMaSystem,代码行数:11,代码来源:Program.cs

示例9: CurrentDomain_UnhandledException

 static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
 {
     if (!Globals.IsSilentInstall) {
         MessageBox.Show(((Exception)e.ExceptionObject).ToString());
     } else {
         Globals.SilentInstallCommunicationPipeStream.WriteString("[Error]" + e.ToString());
         Globals.SilentInstallCommunicationPipe.WaitForPipeDrain();
         Globals.SilentInstallCommunicationPipe.Close();
         System.Environment.Exit(0);
     }
 }
开发者ID:ChaotixBluix,项目名称:Installer,代码行数:11,代码来源:Program.cs

示例10: CurrentDomain_UnhandledException

        static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
        {
            string str = "";
            Exception error = e.ExceptionObject as Exception;
            if (error != null)
                str = string.Format("UnhandledException:{0};\n\r堆栈信息:{1}", error.Message, error.StackTrace);
            else
                str = string.Format("Application UnhandledError:{0}", e);

            Common.WriteLogFile("未知异常:" + str);
            MessageBox.Show("未知异常,请联系作者:"+e.ToString());
        }
开发者ID:GoodManGoodGhost,项目名称:DoWan,代码行数:12,代码来源:Program.cs

示例11: CurrentDomain_UnhandledException

        static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
        {
            Debugger.Instance.logMessage("APP DOMAIN CRASH ", e.ToString());

            StackTrace trace = new StackTrace(true);

            for (int i = 0; i < trace.FrameCount; i++)
            {
                StackFrame sf = trace.GetFrame(i);
                Debugger.Instance.logMessage("High up the call stack, Method: ",  sf.GetMethod().ToString());
                Debugger.Instance.logMessage("High up the call stack, Method: ", sf.GetFileLineNumber().ToString());
            }
        }
开发者ID:ssali,项目名称:Context-Menu---Windows-Sync-,代码行数:13,代码来源:Program.cs

示例12: CurrentDomain_UnhandledException

        /// <summary>
        /// This method is used to trap unhanded exceptions in the service and log them before the service closes.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The exception arguments.</param>
        void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
        {
            if (e == null)
            {
                EventLog.WriteEntry(this.ServiceName, "SERVICE CRASH - no data was passed.", EventLogEntryType.Error);
                return;
            }
                      
            Exception ex = e.ExceptionObject as Exception;
            if (ex == null)
            {
                EventLog.WriteEntry(this.ServiceName, 
                    "SERVICE CRASH THE FOLLOWING ERROR CAUSED THE SERVICE TO FAIL: " 
                    + e.ToString(), EventLogEntryType.Error);
                return;
            }

            EventLog.WriteEntry(this.ServiceName, 
                "SERVICE CRASH THE FOLLOWING ERROR CAUSED THE SERVICE TO FAIL: " + ex.Message
                + Environment.NewLine + Environment.NewLine + ex.ToString(), EventLogEntryType.Error);
        }
开发者ID:mbmccormick,项目名称:Ximura,代码行数:26,代码来源:ApplicationService.cs

示例13: UnhandledException

        public static void UnhandledException(object sender, UnhandledExceptionEventArgs ex)
        {
            string logPath = Environment.GetCommandLineArgs()[0] + ".log";

            if (!File.Exists(logPath))
            {
                File.AppendText(logPath);
            }
            StreamWriter logFile = new StreamWriter(logPath, true);
            logFile.WriteLine();
            logFile.WriteLine();
            logFile.WriteLine();
            logFile.WriteLine("-----------------------------------------");
            logFile.WriteLine("System Environment is " + System.Environment.OSVersion.Platform + " With " + System.Environment.ProcessorCount + " Logical Cores");
            logFile.WriteLine("Application Arguments were " + Environment.GetCommandLineArgs());
            logFile.WriteLine("Exception occurred at {0}", DateTime.Now.ToString());
            logFile.WriteLine("-----------------------------------------");
            logFile.WriteLine(ex.ToString());
            logFile.WriteLine("-----------------------------------------");
            logFile.Flush();
            logFile.Close();
        }
开发者ID:dcramer,项目名称:nibbits-maploader,代码行数:22,代码来源:Logger.cs

示例14: CurrentDomain_UnhandledException

 void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
 {
     logger.Trace(e.ToString());
 }
开发者ID:ChrisPea,项目名称:Trionic,代码行数:4,代码来源:frmMain.cs

示例15: LogUnhandledException

 /// <summary>
 /// A handler for all uncaught exceptions. We log, but we'll still die
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="args"></param>
 void LogUnhandledException(object sender, UnhandledExceptionEventArgs args)
 {
     Exception e = (Exception)args.ExceptionObject;
     logger.Log("Got unhandled exception from {0}: {1}\nException: {2}", sender.ToString(), args.ToString(), e.ToString());
 }
开发者ID:donnaknew,项目名称:programmingProject,代码行数:10,代码来源:Platform.cs


注:本文中的System.UnhandledExceptionEventArgs.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。