窗体中事件,方法比较多,如果能提供一个捕获异常事件的方法的话,类似于B/S中的application_error事件什么的。这样我就不必在每个方法,事件里都要去写try{}....catch(){}了。有这样的一个事件么,如果没有的话,有其他的解决办法么? 谢谢!
解决方案 »
- ListView 显示数据项?
- 沒有字段,直接給屬性賦值,為什么會出錯?
- StreamWriter如何循环追加到指定文件?
- 无漏偏逢连夜雨, 这个还没解决那里又出现问题
- 局域网对共享服务器上文件进行读取删除操作
- 请问 socket 如何实现同时点对点的相互传输
- bindingNavigator删除提示问题
- textbox内容如何与dgv一起打印出来?
- 如何将数据库(SqlServer)中的一个字段(text)中的数据读到一个流中?(up有分)
- 想在家赚美元的进来,我并非善良到有钱自己不赚让别人赚,而是老外的钱,不赚白不赚,大家一起赚嘛。只有一个要求,赚到钱的给我发封信,
- 关于Socket的广播问题:
- 十万火急
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1()); Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);
} static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e)
{
throw new NotImplementedException();
}
Application.SetCompatibleTextRenderingDefault(false);
Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
Application.EnableVisualStyles();
Application.Run(new Frm_Login());
}
static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e)
{
} static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
}