简单问题:ASP中有没有把十六进制数转换成十进制数的函数,没有请写个给我,谢谢!
---------------------------------------------------------------
1
2response.write("A is :" & clng(&hA))
3response.write("64 is :" & clng(&h64))
---------------------------------------------------------------
'对不起没有写非法字符的判断
Function hextointer(strin)
Dim i, j, k, result
result = 0
For i = 1 To Len(strin)
If Mid(strin, i, 1) = "F" Then
j = 15
End If
If Mid(strin, i, 1) = "E" Then
j = 14
End If
If Mid(strin, i, 1) = "D" Then
j = 13
End If
If Mid(strin, i, 1) = "C" Then
j = 12
End If
If Mid(strin, i, 1) = "B" Then
j = 11
End If
If Mid(strin, i, 1) = "A" Then
j = 10
End If
If Mid(strin, i, 1) <= "9" And Mid(strin, i, 1) >= "0" Then
j = CInt(Mid(strin, i, 1))
End If
For k = 1 To Len(strin) - i
j = j * 16
Next
result = result + j
Next
hextointer = result
End Function