using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;namespace 客户端
{static class Program{/// <summary>/// 应用程序的主入口点。/// </summary>[STAThread]static void Main(){// UI线程中的所有异常Application.ThreadException += Application_ThreadException;// 除UI线程中的所有异常AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;Application.EnableVisualStyles();Application.SetCompatibleTextRenderingDefault(false);Application.Run(new Form1());}private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e){//显异常详细信息MessageBox.Show(e.ExceptionObject.ToString());}private static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e){//显示异常详细信息MessageBox.Show(e.Exception.ToString());}}
}