winforms控制的全局异常处理 [英] Global Exception Handling for winforms control

查看:21
本文介绍了winforms控制的全局异常处理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在处理 ASP.NET 1.1 项目时,我总是使用 Global.asax 来捕获所有错误.我正在寻找一种类似的方法来捕获 Windows 窗体用户控件中的所有异常,该控件最终成为托管的 IE 控件.做这样的事情的正确方法是什么?

When working on ASP.NET 1.1 projects I always used the Global.asax to catch all errors. I'm looking for a similar way to catch all exceptions in a Windows Forms user control, which ends up being a hosted IE control. What is the proper way to go about doing something like this?

推荐答案

您需要处理 Windows 窗体的 System.Windows.Forms.Application.ThreadException 事件.这篇文章对我很有帮助:http://bytes.com/forum/thread236199.html.

You need to handle the System.Windows.Forms.Application.ThreadException event for Windows Forms. This article really helped me: http://bytes.com/forum/thread236199.html.

这篇关于winforms控制的全局异常处理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆