I have for instance the following string: “0x780000105d0e0030”
If this is not the string, I can easily get the value as follows:
ulong myValue = 0x780000105d0e0030;
which give me the value of: 8646911354832027696
However, when I want to parse it as follows:
var myValue2= Convert.ToInt64("0x780000105d0e0030",16)
which give me the value of: 8070450566607667200
Then, then myValue is different than myValue2. myValue is correct however and this is how it should work. What am I doing wrong?
Int64is a signedlong.Use
Convert.ToUInt64instead: