Equivalent to Windows Error Codes in .NET

廉价感情. 提交于 2019-12-10 17:35:56

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!