Hi,

I use some existing code,packaged in a dll file.I want my code to be robust,so in places where existing code throws a exception,I want to handle it.
The problem is,I donot know which methods in existing code will throw a exception!I donot have access to the source code,and the document is poorly written.


My question is:
1) In c#,How to declare that a method may throw some exceptions,except by document and comment? Is there a counterpart of java's 'throws'?Or what can I do to mimic 'throws'.

2) In my scenario,what can I do to protoct my code.

I am sorry to ask this question,I am sure somebody has asked it before!

Thanks.