110,570
社区成员
发帖
与我相关
我的任务
分享
Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
Application.Run(new Form1());
static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
//get log
}
static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e)
{
//get log
}
通过日志查看,比猜测来的更直接有效些