发表于:2003-07-21 21:05:00
2楼
public Function strToHex(str As String) As Integer
Dim intH, intL As Integer
intH = Asc(Mid$(str, 2, 1))
intL = Asc(Mid$(str, 3, 1))
If intH >= 48 And intH <= 57 Then
intH = intH - 48
Else
intH = intH - 65
End If
If intL >= 48 And intL <= 57 Then
intL = intL - 48
Else
intL = intL - 65
End If
strToHex = intH * 16 + intL
End Function