解码: function URLDecode(enStr) dim deStr,strSpecial dim c,i,v deStr="" strSpecial="!""#$%&'()*+,.-_/:;<=>?@[\]^`{|}~%" for i=1 to len(enStr) c=Mid(enStr,i,1) if c="%" then v=eval("&h"+Mid(enStr,i+1,2)) if inStr(strSpecial,chr(v))>0 then deStr=deStr&chr(v) i=i+2 else v=eval("&h"+ Mid(enStr,i+1,2) + Mid(enStr,i+4,2)) deStr=deStr & chr(v) i=i+5 end if else if c="+" then deStr=deStr&" " else deStr=deStr&c end if end if next URLDecode=deStr end function 编码: Function URLEncoding(vstrIn) strReturn = "" For i = 1 To Len(vstrIn) ThisChr = Mid(vStrIn,i,1) If Abs(Asc(ThisChr)) < &HFF Then strReturn = strReturn & ThisChr Else innerCode = Asc(ThisChr) If innerCode < 0 Then innerCode = innerCode + &H10000 End If Hight8 = (innerCode And &HFF00)\ &HFF Low8 = innerCode And &HFF strReturn = strReturn & "%" & Hex(Hight8) & "%" & Hex(Low8) End If Next URLEncoding = strReturn End Function %>
ASP的URL编码和解码函数
原创
©著作权归作者所有:来自51CTO博客作者泥土变器皿的原创作品,请联系作者获取转载授权,否则将追究法律责任
上一篇:用Jquery动态添加控件并取值
下一篇:我的友情链接
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
URL编码和解码工具
开发中发现需要进行URL的编解码,每次百度出来的还带广告而且比较慢,写了一个本地的工具,比较简单,希望对大家有帮助。 需要解码的URL: 解码后的URL或者待编码的URL: 编码后...
url编码 解码 decode encode html -
golang中的URL 的编码和解码(转)golang
-
javascript的URL编码和解码
在使用url进行参数传递时,经常会传递一些中文名的参数或URL地址,在后台处理时会发生转换错误。在有些传递页面使用GB2312,而在接收页面使用UTF8
URL编码 URL解码 escape encodeURI 字符串 -
.Net Core URL编码和解码
一、URL说明 .Net Core中http 的常用操作封装在 HttpUtility 中 命名空间 二、代码
html .net 加密解密 编码解码