Program.cs 累积_C#
2014-05-13 10:30
211 查看
using System; using System.Diagnostics; using System.Threading; using System.Windows.Forms; using UtilityClass; namespace Program { static class Program { /// <summary> /// 应用程序的主入口点。 /// </summary> [STAThread] static void Main() { // 增加捕获 ApplicationEventHandlerClass AppEvents = new ApplicationEventHandlerClass(); Application.ThreadException += new ThreadExceptionEventHandler(AppEvents.OnThreadException); // 开始监听 Trace.Listeners.Clear(); Trace.Listeners.Add(new TraceLog(Application.StartupPath + "\\Error.Log")); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); if (new FormLogin().ShowDialog() == DialogResult.OK) Application.Run(FormMain.Instance); } public class ApplicationEventHandlerClass { public void OnThreadException(object sender, ThreadExceptionEventArgs e) { Trace.Write(e.Exception, "未捕获的异常"); ShowMsg.ShowErr(sender as IWin32Window, "程序出现错误:\r\n" + e.Exception.Message + "\r\n\r\n请联系管理员以解决此问题!"); } } } }
相关文章推荐
- c# WinForm 登陆 Program.cs 中代码
- c# - CS-Script - The C# Script Engine
- C#之 CS开发常用功能
- c#将aspx和cs分离
- C# 在.cs文件中使用正则表达式
- C#的CSREPL-REPL
- C#中使用异步Socket编程实现TCP网络服务的CS的通讯构架(一)----基础类库部分
- 常用的C#方法【Format.CS】
- (5)C#之ADO.NET 手写SqlHelp.cs 以及改进
- C#脚本引擎 CS-Script 之(二)——性能评测
- C# 解决InvalidProgramException: Invalid IL code in System.Data.DataTable:get_Columns (): IL_0000: ret
- C# 调用WebService的3种方式 :直接调用、根据wsdl生成webservice的.cs文件及生成dll调用、动态调用
- C# WinFrom(CS)程序调用 WEB 站点,获取响应内容
- c# hello world csc test.cs
- 【C#】获取程序中Properties下的AssemblyInfo.cs下的信息
- C#中的cookie编程 来自http://www.ddvip.net/program/c-/index6/70.htm
- c#使用实例之命令行编译cs源码demo.cs
- C#一般处理程序 ashx.cs使用Session报错的处理
- C#使用异步Socket实现TCP网络服务的CS的通讯构架(二)使用方法
- C# AssemblyInfo.cs控制EXE程序版本信息