相当于 .NET 中的 Windows 错误代码

发布于 2024-09-29 09:26:56 字数 161 浏览 1 评论 0原文

Microsoft 为 Windows 提供了一系列标准化错误代码 (http://msdn.microsoft.com/en-us/library/ms681381(VS.85).aspx)。当适用时,我发现它们可以在我自己的应用程序中参考,而不是创建我自己的应用程序。有类似但特定于 .NET 的东西吗?

Microsoft provides a bunch of standardized error codes for Windows (http://msdn.microsoft.com/en-us/library/ms681381(VS.85).aspx). When applicable I find them useful to reference in my own applications, instead of creating my own. Is there something similar but specific to .NET?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

小镇女孩 2024-10-06 09:26:56

.NET 不鼓励使用错误代码。相反,应专注于使用或派生标准异常类。

在 .NET 开发中,异常应该优先于错误代码。

.NET discourages the use of error codes. Instead, focus on using, or deriving from, the standard Exception classes.

Exceptions should be preferred to error codes in .NET development.

殊姿 2024-10-06 09:26:56

我同意 Reed Copsey 的观点,错误代码是过去错误处理方法的“残余”。

执行 i 的新方法是 异常处理

I agree with Reed Copsey, error codes are "remainings" from the past error handling methods.

The new way of doing i is Exception Handling.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文