gpt4 book ai didi

c# - 如何捕获 .NET 应用程序中的所有异常/崩溃

转载 作者:IT王子 更新时间:2023-10-29 03:58:01 24 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
.NET - What’s the best way to implement a “catch all exceptions handler”

我有一个 .NET 控制台应用程序崩溃并向用户显示一条消息。我所有的代码都在 try{<code>} catch(Exception e){<stuff>} 中 block ,但偶尔仍会显示错误。

在 Win32 应用程序中,您可以通过安装各种异常处理程序来捕获所有可能的异常/崩溃:

/* C++ exc handlers */
_set_se_translator
SetUnhandledExceptionFilter
_set_purecall_handler
set_terminate
set_unexpected
_set_invalid_parameter_handler

在 .NET 世界中有什么等价物可以让我处理/记录/安静所有可能的错误情况?

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com