c# - Throwing ExternalException with custom HResult -
i wanted throw exception custom hresult or errorcode have tried externalexception
code
throw new externalexception("login required", 0x6acfc5);
however when catch exception , it's hresult
, find not 0x6acfc5
strange negative number.
externalexception("login required", 0x6acfc5)
this constructor accept errorcode second parameter, , in system.int32
when give value 0x6acfc5
convert int value 7000005
, that's see hresult
if call ex.hresult.tostring("x")
6acfc5
note: tostring("x")
convert int value hexadecimal string
Comments
Post a Comment