How do you convert hex to decimal using VB.NET?

后端 未结 9 1794
自闭症患者
自闭症患者 2020-12-11 03:04

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 th

9条回答
  •  感情败类
    2020-12-11 03:28

    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)
    

提交回复
热议问题