我怎么知道一个类会抛出什么样的异常? [英] How can i know what kind of exception a class will throw?

查看:37
本文介绍了我怎么知道一个类会抛出什么样的异常?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

MSDN上的任何页面或某个地方可以告诉我们,特定类将抛出哪种异常?

is there any page from MSDN or somewhere can tell us, what kind of exception will be throw from a specific class?

,例如FtpWebRequest.我如何找出它将引发什么样的异常?来自MSDN的页面并没有真正的帮助 http://msdn.microsoft.com/en-us/library/system.net.ftpwebrequest%28v = VS.100%29.aspx

for example, FtpWebRequest. how can i find out what kind of exception it will throw?? the page from MSDN is not really helpful http://msdn.microsoft.com/en-us/library/system.net.ftpwebrequest%28v=VS.100%29.aspx

谢谢

推荐答案

类不会引发异常.成员(属性和方法)可以.因此,您需要查看文档以供单个成员了解.

Classes don't throw exceptions. Members (Properties and Methods) do. So you need to look at the documentation for the individual members to know.

这篇关于我怎么知道一个类会抛出什么样的异常?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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