问题
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?
回答1:
.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.
回答2:
I agree with Reed Copsey, error codes are "remainings" from the past error handling methods.
The new way of doing i is Exception Handling.
来源:https://stackoverflow.com/questions/4044995/equivalent-to-windows-error-codes-in-net