using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using CCT.Ctcw.Windows.Comm;
using System.Threading;
namespace CCT.Ctcw.Windows
{
static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.ThreadException += new ThreadExceptionEventHandler(Application_ThreadException);
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
Application.Run(new FrmMain());
}
static void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
{
FrmMsg frm = new FrmMsg("网络异常", e.Exception.Message, false, "C");
frm.ShowDialog();
//MessageBox.Show(e.Exception.Message, "发生网络异常,请联系系统管理员!","网络异常", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
// here you can log the exception ...
}
static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
FrmMsg frm = new FrmMsg("网络异常", (e.ExceptionObject as Exception).Message, false, "C");
frm.ShowDialog();
//MessageBox.Show((e.ExceptionObject as Exception).Message, "发生网络异常,请联系系统管理员!");
// here you can log the exception ...
}
}
}
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using CCT.Ctcw.Windows.Comm;
using System.Threading;
namespace CCT.Ctcw.Windows
{
static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.ThreadException += new ThreadExceptionEventHandler(Application_ThreadException);
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
Application.Run(new FrmMain());
}
static void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
{
FrmMsg frm = new FrmMsg("网络异常", e.Exception.Message, false, "C");
frm.ShowDialog();
//MessageBox.Show(e.Exception.Message, "发生网络异常,请联系系统管理员!","网络异常", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
// here you can log the exception ...
}
static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
FrmMsg frm = new FrmMsg("网络异常", (e.ExceptionObject as Exception).Message, false, "C");
frm.ShowDialog();
//MessageBox.Show((e.ExceptionObject as Exception).Message, "发生网络异常,请联系系统管理员!");
// here you can log the exception ...
}
}
}