VB.NET中怎么将16进制数换成对应的ASCII,比如说&H1000,怎么把他换成31H,30H,30H,30H
答案:1 悬赏:0 手机版
解决时间 2021-01-16 08:44
- 提问者网友:wodetian
- 2021-01-15 20:44
VB.NET中怎么将16进制数换成对应的ASCII,比如说&H1000,怎么把他换成31H,30H,30H,30H
最佳答案
- 五星知识达人网友:轻雾山林
- 2021-01-15 22:18
Public Function dec_to_hex(dec As Long) As String
Dim a As String
dec_to_hex = ""
Do While dec > 0
a = CStr(dec Mod 16)
Select Case a
Case "0": a = "30H"
Case "1": a = "31H"
Case "2": a = "32H"
Case "3": a = "33H"
Case "4": a = "34H"
Case "5": a = "35H"
Case "6": a = "36H"
Case "7": a = "37H"
Case "8": a = "38H"
Case "9": a = "30H"
Case "10": a = "65H"
Case "11": a = "66H"
Case "12": a = "67H"
Case "13": a = "68H"
Case "14": a = "69H"
Case "15": a = "70H"
End Select
dec_to_hex = a & " " & dec_to_hex
dec = dec \ 16
Loop
End Function追问我把&H1000代入,然后把结果相加得出121.,怎么自动把121变成C1的追答121是16进制还是10进制
Dim a As String
dec_to_hex = ""
Do While dec > 0
a = CStr(dec Mod 16)
Select Case a
Case "0": a = "30H"
Case "1": a = "31H"
Case "2": a = "32H"
Case "3": a = "33H"
Case "4": a = "34H"
Case "5": a = "35H"
Case "6": a = "36H"
Case "7": a = "37H"
Case "8": a = "38H"
Case "9": a = "30H"
Case "10": a = "65H"
Case "11": a = "66H"
Case "12": a = "67H"
Case "13": a = "68H"
Case "14": a = "69H"
Case "15": a = "70H"
End Select
dec_to_hex = a & " " & dec_to_hex
dec = dec \ 16
Loop
End Function追问我把&H1000代入,然后把结果相加得出121.,怎么自动把121变成C1的追答121是16进制还是10进制
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯