简体   繁体   中英

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 of 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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM