日期:2014-05-17  浏览次数:20858 次

请教各位大侠帮我把这段JS函数改成ASP?
-----开始------------
function   urldecode(source_url){
var   return_url   =   " ";
var   regex   =   ".:/-_0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ";
var   tmp   =   " ";
var   newside   =   -1;
for(var   i   =   0;   i   <   source_url.length;   i   ++){
tmp   =   source_url.charAt(i);
newside   =   -1;
newside   =   regex.indexOf(tmp);
if(newside   > =   0){
newside   =   (newside   +   regex.length   -   7)   %   regex.length;
return_url   +=   regex.charAt(newside);
}
else{
return_url   +=   tmp;
}
}
return   return_url;
}
---------结束----------

------解决方案--------------------
<%
-----开始------------
function urldecode(source_url)
dim return_url = " "
const regex = ".:/-_0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ "
dim tmp = " "
dim newside = -1
for i=0 to length(source_url)
tmp = source_url.charAt(i)
newside = -1
newside = regex.indexOf(tmp)
if newside > = 0 then
newside = (newside + length(regex) - 7) % length(regex)
return_url =return_url+ regex.charAt(newside)

else
return_url=return_url+tmp
end if
next
return return_url

---------结束----------
%>
有几个函数我不知道,你自己查查