NET 1.1 Exception problem

  • Thread starter Thread starter Adam Klobukowski
  • Start date Start date
A

Adam Klobukowski

I have following problem with exceptions: it seems that there is not
enough exception classes for me.

Let me explain:

System.IO.File.Create can throw System.IO.IOException if few cases: path
not found, sharing violation etc. But now, how can I check if it fas
sharing violation or path not found? I could chceck Mesage for a string,
but it will differ becouse of localization.

How can I distiguish two types of System.IO.IOException?

Is it any better in NET 2.0?
 
Adam,

you should be able to retrieve the underlying HResult by calling
Marshal.GetHRForException(yourIOException).

rgds,
Baileys
 
Back
Top