Hello,
The HResult code in an IOException is a Protected member. How on Earth am I
supposed to read the HResult if it is protected?
My program needs to determine the exact cause of any IOException that occurs
in the WebRequest class. How can I do this if I can't access the HResult
field because it is protected?
I understand that I could read the field in a derived class, but the
WebRequest class is not going to throw my derived exception, it's going to
throw one of the built-in exceptions.
This is very frustrating.
Thank you very much,
Rich S.
Mattias Sjögren - 19 Dec 2005 20:37 GMT
>The HResult code in an IOException is a Protected member. How on Earth am I
>supposed to read the HResult if it is protected?
Try calling Marshal.GetHRForException
Mattias

Signature
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Rich S. - 19 Dec 2005 20:50 GMT
Thanks, Mattias!! You really saved me from pulling my hair out!!
> >The HResult code in an IOException is a Protected member. How on Earth am I
> >supposed to read the HResult if it is protected?
>
> Try calling Marshal.GetHRForException
>
> Mattias