本文介绍了将已检查的异常添加到C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我昨晚喝了太多咖啡,并提出了一个关于 如何 的建议,将检查过的例外添加到C# http://www.geocities.com/jeff_louie/OOP/oop14.htm 预期评论< g> 问候, 杰夫 ***通过开发人员指南 http://www.developersdex.com *** 不要只是参加USENET ......获得奖励!I drank too much coffee last night and came up with a suggestion abouthowto add checked exceptions to C# http://www.geocities.com/jeff_louie/OOP/oop14.htmComments expected <g>Regards,Jeff*** Sent via Developersdex http://www.developersdex.com ***Don''t just participate in USENET...get rewarded for it!推荐答案 据我所知,合同中的这个问题会受到同样的问题的影响,我需要定期检查例外情况。 为什么我必须抓住MyClassFileNotFoundException和 YourClassFileNotFoundException只是因为人为的异常 合约?或者更糟糕的是MyClassYourClassFileNotFoundException和 YourClassMyClassFileNotFoundException。 在我看来,你可能最终得到了几十个例外, 意味着同样的事情,但只是有不同的起源点。As best I can tell, this catch by contract suffers from the same problem Ihave with regular checked exceptions.Why is it that I would have to catch MyClassFileNotFoundException andYourClassFileNotFoundException simply because of artificial exceptioncontracts? Or worse MyClassYourClassFileNotFoundException andYourClassMyClassFileNotFoundException.It seems to me you may actually end up with several dozen exceptions thatmean the same thing, but just have different points of origin. 这篇关于将已检查的异常添加到C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-22 17:12