How can i know what kind of exception a class will throw?
is there any page from MSDN or somewhere can tell us, what kind 开发者_如何学Pythonof exception will be throw from a specific class?
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
Thanks
Classes don't throw exceptions. Members (Properties and Methods) do. So you need to look at the documentation for the individual members to know.
As others said, the intellisense will tell you. In addition, you could step into the framework code itself.
In addition, the documentation for each method contains the list of exceptions it might throw. Example.
精彩评论