您现在的位置是:网站首页> 编程资料编程资料
ASP让url的中文显示为编码_应用技巧_
                    
                
                2023-05-25
                198人已围观
            
简介 ASP让url的中文显示为编码_应用技巧_
                asp解码url 
解码函数
[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]
        复制代码 代码如下:
解码函数
[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]
相关内容
- ASP下使用Access数据库需要注意的18条安全法则_应用技巧_
 - SQL查询语句通配符与ACCESS模糊查询like的解决方法_应用技巧_
 - asp google pr查询代码_应用技巧_
 - asp中获取当前月份距离以前某个时间的月份数_应用技巧_
 - asp中最新新闻显示new图片的实现代码_应用技巧_
 - 捕捉并保存ASP运行错误的函数代码_应用技巧_
 - ASP 下载时重命名已上传文件的新下载文件名的实现代码_应用技巧_
 - ASP FSO显示特殊文件夹的实现代码(畸形目录名、UNC路径)_应用技巧_
 - ASP 改良版MD5、SHA256多重加密类(二次及多次)_应用技巧_
 - asp中记录集对象的getrows和getstring用法分析_应用技巧_
 
                                
                                                        
                                
                                                        
                                
                                                        
    