I need to convert hex to a decimal in VB.NET. Found several examples in C#, but when I tried to convert to VB.NET I was not successful. An example of a hexadecimal number that I am trying to convert is "A14152464C203230304232323020572F544947455234352E".
Tried the others replies and this was the one that worked for me:
Convert.ToInt32(yourHEXString, 16)
Documentation
For hex values which don't actually require a bignum class to work with, you can use the normal conversion function but prefix the number with "&H". VB interprets "&H" in the text as meaning "this is a hex number", just like it does in code.
dim n = Cint("&H" & text)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With