我们有“接下来的错误恢复”吗?在C#? [英] Do we have "on error resume next" in C#?

查看:68
本文介绍了我们有“接下来的错误恢复”吗?在C#?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我知道这不是一个好习惯,但我想知道我们有没有出错

resume next"在C#中?


谢谢,


Max

Hi,

I know that this is not a good practice, but I wonder do we have "on error
resume next" in C#?

Thanks,

Max

推荐答案

Max,


不,你疯了吗? :)


说真的,不,没有,而且都是因为你期望的原因。
真的有一个你可以使用try / catch块做很多事情。小心

构造的代码可以做同样的事情。询问您是否有特定的

需要有人可以帮忙。

Stephan

Maxwell2006写道:
Max,

No. Are you nuts? :)

Seriously, no, there isn''t, and all for the reasons that you''d expect.
There''s really a whole lot you can do with try/catch blocks. Carefully
constructed code could do the same and more. Ask if you have a specific
need that someone may be able to help with.
Stephan
Maxwell2006 wrote:




我知道这不是一个好习惯,但我想知道我们有没有出错

resume next"在C#中?


谢谢,


最高
Hi,

I know that this is not a good practice, but I wonder do we have "on error
resume next" in C#?

Thanks,

Max


I知道这不是一个好习惯,但我想知道我们有没有错误
I know that this is not a good practice, but I wonder do we have "on error

resume next"在C#?
resume next" in C#?



Try..catch..finally是最好的方式......在错误恢复下一步会是

可怕的东西:-)


-


// \ / \\ 3rL1n_______

Try..catch..finally is the best way... "on error resume next" would be
something horrible :-)

--

//\/\\3rL1n_______


Maxwell2006< al ****** @ newsgroup.nospamwrote:
Maxwell2006 <al******@newsgroup.nospamwrote:

我知道这不是一个好习惯,但我想知道我们有没有出错

resume next"在C#?
I know that this is not a good practice, but I wonder do we have "on error
resume next" in C#?



幸运的是没有。在循环中使用

try / catch可以获得类似的功能。


-

Jon Skeet - < sk ***@pobox.com>
http://www.pobox.com / ~siget 博客: http://www.msmvps.com/jon .skeet

如果回复小组,请不要给我发邮件

Fortunately not. Similar functionality can be obtained by using
try/catch within a loop.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too


这篇关于我们有“接下来的错误恢复”吗?在C#?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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