js 代码 改写 为 asp代码
functiondecode(url){varlen=url.length;vardecurl="";varasc_arr1=[],asc_arr2=[];varkey=...
function decode(url){
var len = url.length;
var decurl = "";
var asc_arr1 = [], asc_arr2 = [];
var key = sertim % 26;
key = key ? key : 1;
function init(head, bottom, middle){
for (var i = head; i <= bottom; i++) {
asc_arr1[i] = i + middle;
asc_arr2[i + middle] = i;
}
}
init(0, 9, 48);
init(10, 35, 55);
init(36, 61, 61);
for (var i = 0; i < len; i++) {
var word = url.charAt(i);
if (/[A-Za-z0-9]/.test(word)) {
var pos = asc_arr2[url.charCodeAt(i)] - key;
if (pos < 0)
pos += 62;
word = String.fromCharCode(asc_arr1[pos]);
}
decurl += word;
}
return decurl;
}
自己尝试,没有成功!
<%
dim asc_arr1(), asc_arr2()
function decode(url,ss)
dim sertim = ss
dim len = length(url)
dim decurl = ""
dim key = sertim Mod 26
If key=0 Then key=1
init 0, 9, 48
init 10, 35, 55
init 36, 61, 61
for i = 0 to len
set reg=new regexp
reg.ignorecase=true
reg.pattern="[a-z\d]"
for i=1 to len
dim word = mid(url,i,1)
if reg.test(word) then
var pos = asc_arr2(asc(word)) - key
if (pos < 0) then pos =pos+ 62
word = chr(asc_arr1(pos))
end if
next
set reg=Nothing
decurl = word
next
decode=decurl
End Function
function init(head, bottom, middle)
redim preserve asc_arr1(bottom)
redim preserve asc_arr2(bottom+middle)
for i = head to bottom
asc_arr1(i)= i + middle
asc_arr2(i + middle) = i
next
End Function
%>
<%
dim keyword,gtype
keyword= decode("jvvr://nkuvgp.kfl.348.pgv/ph/B62/d5Bgeddf7dBA6e72A73293A97ge36276.or5" || "jvvr://nkuvgp.kfl.348.pgv/ph/B62/d5Bgeddf7dBA6e72A73293A97ge36276.or5",1292635216)
response.write keyword
%>
binjly 的答案不怎么满意,我运行
<script runat="server">
js_func(arg) {
return "接收到:" + arg
}
</script>
<%
response.write js_func('test')
%>
没有成功
急急急,麻烦高手来指点指点!!! 展开
var len = url.length;
var decurl = "";
var asc_arr1 = [], asc_arr2 = [];
var key = sertim % 26;
key = key ? key : 1;
function init(head, bottom, middle){
for (var i = head; i <= bottom; i++) {
asc_arr1[i] = i + middle;
asc_arr2[i + middle] = i;
}
}
init(0, 9, 48);
init(10, 35, 55);
init(36, 61, 61);
for (var i = 0; i < len; i++) {
var word = url.charAt(i);
if (/[A-Za-z0-9]/.test(word)) {
var pos = asc_arr2[url.charCodeAt(i)] - key;
if (pos < 0)
pos += 62;
word = String.fromCharCode(asc_arr1[pos]);
}
decurl += word;
}
return decurl;
}
自己尝试,没有成功!
<%
dim asc_arr1(), asc_arr2()
function decode(url,ss)
dim sertim = ss
dim len = length(url)
dim decurl = ""
dim key = sertim Mod 26
If key=0 Then key=1
init 0, 9, 48
init 10, 35, 55
init 36, 61, 61
for i = 0 to len
set reg=new regexp
reg.ignorecase=true
reg.pattern="[a-z\d]"
for i=1 to len
dim word = mid(url,i,1)
if reg.test(word) then
var pos = asc_arr2(asc(word)) - key
if (pos < 0) then pos =pos+ 62
word = chr(asc_arr1(pos))
end if
next
set reg=Nothing
decurl = word
next
decode=decurl
End Function
function init(head, bottom, middle)
redim preserve asc_arr1(bottom)
redim preserve asc_arr2(bottom+middle)
for i = head to bottom
asc_arr1(i)= i + middle
asc_arr2(i + middle) = i
next
End Function
%>
<%
dim keyword,gtype
keyword= decode("jvvr://nkuvgp.kfl.348.pgv/ph/B62/d5Bgeddf7dBA6e72A73293A97ge36276.or5" || "jvvr://nkuvgp.kfl.348.pgv/ph/B62/d5Bgeddf7dBA6e72A73293A97ge36276.or5",1292635216)
response.write keyword
%>
binjly 的答案不怎么满意,我运行
<script runat="server">
js_func(arg) {
return "接收到:" + arg
}
</script>
<%
response.write js_func('test')
%>
没有成功
急急急,麻烦高手来指点指点!!! 展开
1个回答
展开全部
不用写,直接用js标签的runat="_server"属性,js就变成asp的一部分了,你就可以直接调用了。
看参考资料
看参考资料
参考资料: http://blog.zo200.com/2010/02/06/82.html
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询