Get HResult out of System.Exception class

System.Exception has a protected property HResult. To read the property, use System.Runtime.InteropServices.Marshal.GetHRForException().