asp解码url 复制代码 代码如下: <a href="1.asp?action=<%=server.urlencode("你好")%>">asdf</a> 解码函数 [code] <% 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(request.QueryString("action")) %> [html]
推荐阅读
rs.open sql,conn,1,1与rs.open sql,conn,1.3还有rs.open sql,conn,3,2区别
经常开发asp但对于细致的说法,真实不太清楚,这里简单的介绍下。一般情况下读取数据都是用rs.open sql,conn,1,1修改数据:rs.open sql,conn,1,3删除数据:直接要conn.execute("delete * from new where id=1")这样的>>>详细阅读
本文标题:ASP让url的中文显示为编码
地址:http://www.17bianji.com/kaifa2/ASP/31858.html
1/2 1