我如何从“抛出新例外”中受益? [英] How i can benefit from "Throw New exception" ?

查看:72
本文介绍了我如何从“抛出新例外”中受益?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何受益抛出新的异常

我如何在我的项目中使用它?任何一个例子?

How I can benefit From "Throws a new exception"
How i can use it in my projects ? any example ?

推荐答案

当你检测到你的应用程序中的问题时,你可以使用它,以及如何向代码的其他部分指出它可以处理它,或者导致它你的程序退出并告诉用户 - 这样错误不会导致他的数据被破坏。



试试这里:http://msdn.microsoft.com/en-us/library/vstudio/fk6t46tz.aspx [ ^ ] - 它解释了原因,并给出了一个例子。
You use it when you detect a problem in your application and what to indicate it to some other part of your code that can handle it, or cause your program to exit and tell the user - so that the error does not cause his data to be corrupted.

Try reading here: http://msdn.microsoft.com/en-us/library/vstudio/fk6t46tz.aspx[^] - it explains why, and gives an example.

有你朋友的名字是GOOGLE。经常访问他,你的问题将得到解答。这里有一些链接



http:// msdn.microsoft.com/en-us/library/ms173163.aspx [ ^ ]



http://stackoverflow.com/questions/2999298/difference-between-throw-and-throw-new-exception [ ^ ]
there is friend of your's his name is GOOGLE. Pay him frequent visits and your question will be answered. here are some links

http://msdn.microsoft.com/en-us/library/ms173163.aspx[^]

http://stackoverflow.com/questions/2999298/difference-between-throw-and-throw-new-exception[^]


这篇关于我如何从“抛出新例外”中受益?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆