这个是用了ASP内置server对象的URLencode方法
你试试在ASP中运行下面内容
<%
'加密
response.write server.URLencode("枪王之王")
%>
<%
'如果想对server.URLencode中密过的内容进行解密的话可以参考以下:
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
response.write URLDecode("%E6%9E%AA%E7%8E%8B%E4%B9%8B%E7%8E%8B")
%>
温馨提示:答案为网友推荐,仅供参考