字符串转十六进制
StrToHex Function
<%
Response.Write StrToHex("Nice co
'--- returns: 4E69636520636F6465
Function StrToHex(ByRef Str)
Dim Length
Dim Max
Dim strHex
Max = Len(Str)
For Length = 1 To Max
strHex = strHex & Right("0" & Hex(Asc(Mid(Str, Length, 1))), 2)
Next
StrToHex = strHex
End function
%>
十六进制转字符串
HexToStr
<%
Function HexToStr(ByRef strHex)
Dim Length
Dim Max
Dim Str
Max = Len(strHex)
For Length = 1 To Max Step 2
Str = Str & Chr("&h" & Mid(strHex, Length, 2))
Next
HexToStr = Str
End function
%>
字符串转十六进制【转帖】
2012-05-24 09:17:48
阅读 4687 次
评论 0 条
发表评论