相当于Windows错误codeS在.NET错误、Windows、NET、codeS

2023-09-04 12:07:46 作者:8.川上

Microsoft提供的Windows一堆标准化错误codeS(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?

推荐答案

.NET鼓励使用错误codeS。相反,集中使用,或从标准的异常类派生。

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

例外应该是preferred错误codeS的.NET开发。

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