VB中将十六进制转化为十进制,代码怎么写啊?
1个回答
展开全部
Dim s as string = "FF" --16进制作为字符串
Dim value as Integer
value = val( "&h" & s ) --10进制整型
---
或用 System.Convert.ToInt32(string, integer)
Dim i As Integer
i = Convert.ToInt32("abcd", 16)
---
Dim s As String = "0A"
MsgBox(CInt("&H" & s))
MsgBox(Convert.ToInt32(s, 16))
Dim value as Integer
value = val( "&h" & s ) --10进制整型
---
或用 System.Convert.ToInt32(string, integer)
Dim i As Integer
i = Convert.ToInt32("abcd", 16)
---
Dim s As String = "0A"
MsgBox(CInt("&H" & s))
MsgBox(Convert.ToInt32(s, 16))
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询