Private Sub STR16to2(ByVal STR1 As String, B() As Byte)
Dim I As Long
On Error Resume Next
I = Len(STR1)
If I And 1 Then
MsgBox "你输入的十六进制位数不对,你要注意每个十六进制数都用两个字符表示(0用00表示)"
Else
I = I \ 2 - 1
ReDim B(I)
Do While I >= 0
B(I) = Val("&H" & Mid(STR1, I * 2 + 1, 2))
I = I - 1
Loop
End If
End Sub
Dim I As Long
On Error Resume Next
I = Len(STR1)
If I And 1 Then
MsgBox "你输入的十六进制位数不对,你要注意每个十六进制数都用两个字符表示(0用00表示)"
Else
I = I \ 2 - 1
ReDim B(I)
Do While I >= 0
B(I) = Val("&H" & Mid(STR1, I * 2 + 1, 2))
I = I - 1
Loop
End If
End Sub
VB QQ群:47715789