【问题标题】:Handle exceptions in AppDomain.CurrentDomain.UnhandledException处理 AppDomain.CurrentDomain.UnhandledException 中的异常
【发布时间】:2009-12-28 19:33:28
【问题描述】:

是否可以处理 AppDomain.CurrentDomain.UnhandledException 回调中的异常? 我想做以下事情:

  • 显示我自己的“异常有 发生”对话框,带有“发送报告” 按钮
  • 用户关闭后 框,我想关闭我的应用程序,但我确实这样做了 不想 Windows 默认崩溃对话框“ 应用程序需要关闭”框 出现。

这个可以吗?

【问题讨论】:

    标签: c# .net vb.net


    【解决方案1】:

    【讨论】:

      【解决方案2】:

      希望此链接对您有所帮助:

      http://www.switchonthecode.com/tutorials/csharp-tutorial-dealing-with-unhandled-exceptions

      如代码所示,只需监听异常并在它发生时做你想做的事。

      【讨论】:

        猜你喜欢
        • 2018-07-01
        • 2020-06-26
        • 1970-01-01
        • 1970-01-01
        • 2021-09-16
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多