免费下载: Ghost全自动系统备份光盘正式版 V4.5 | 硬盘版 V2.0 | 排行榜 TOP50 玩玩小游戏:连连看游戏网 http://www.llkyx.com
首页 >> Asp编程 >> Asp经验技巧 >> ASP字符串16进制互转

ASP字符串16进制互转

时间:2008-6-24 网友评论条 【

字符串转十六进制

StrToHex Function

<%
Response.Write StrToHex("Nice code")
'--- 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
%>

站长工具
IP地址/域名归属地查询:
相关文章
loading 请稍等,评论加载中...

Aspxhome.com. 中国Asp之家. 版权所有

闽ICP备06017341号