Equivalent to Windows Error Codes in .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 appl开发者_JAVA技巧ications, instead of creating my own. Is there something similar but specific to .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.
I agree with Reed Copsey, error codes are "remainings" from the past error handling methods.
The new way of doing i is Exception Handling
.
精彩评论