草根站长论坛's Archiver

石头 发表于 2008-5-25 11:27

绑定多域名的ASP代码 及镜像站自动选择

如果有有一个ASP空间,而你又想放置多个多个站点,这些代码可以帮到你!`&A8fQ/P[Q_
第一个
G a1J$y-zw 程序代码:
)Ci1T7i6@4O [code]<%if Request.ServerVariables("SERVER_NAME")="www.xue5.com" then!`Dx:DL$S:IO
response.redirect "zkj"
8Y;t$h?U(I elsex$B%`%S+Wcj&n8I
response.redirect "i.htm"
!H`3C f2W | end if%>[/code]
GAge v5U)qN wQ7CkJwM"|]
第二个
N(?ItVK 程序代码:AA Gm)u
[code]<%
MHInfJ select case request.servervariables("http_host")#tzak#Oox1en)y
case "www.yyjs.com" '1 U,n\ VT'j-V
Server.Transfer("v3.htm")3vC2y {PM,y'K
case "www.aspcn.net" '2
W-Z9@7W[sp Server.Transfer("i.htm")
-X Ih~XT_Mx case "www.yyjs.cn" '3
aa2z(@^S i:X Server.Transfer("yyjs.htm")
miB#O1yMSI ...... 继续添加 ......
R l9s`9u/V DLNu end select
e,B7z{%o %>[/code],oOdv \0Q)a2M@X
"W5aAWm
第三个j5Kh;XM4e[Gw(bVfu[
程序代码:ROn,d,];s
[code]<%if instr(Request.ServerVariablesKF8s/ryx.F%z
("SERVER_NAME"),"kekexi.com")>0 thenx:d!w%^*_DJbla
response.redirect "index.asp"F#rqL} d
else if instr(Request.ServerVariables
fU4`/TuzS+?v ("SERVER_NAME"),"4668.com")>0 thenm`lV&j-wo2c
response.redirect "x/index.asp"
a*U P5C'XJ else if instr(Request.ServerVariables?5y9OS;zpv&C{
("SERVER_NAME"),"web315.com")>0 thenrA+B,Nno;~3I_
esponse.redirect "index3.asp"
O;^Vy:\l+n5k end ifse/Rd#w s
end if
C!Q"Om-llG] S end if%>[/code]t"Nm9e[r

}8{5?1d)N lnx1Z
y8z[;G0B(mf 第四个7T5P,Q5nRM
程序代码: vY(Z [h2`p)`
[code]<%if Request.ServerVariables("SERVER_NAME")="www.yyjs.com" thenFCXyew V
response.redirect "index1.asp"
(px7B3e:}B%YIF else if Request.ServerVariables("SERVER_NAME")="www.ce.org.cn" then
f8J{ n%w*W7@5H*c response.redirect "index2.asp"V"L_p FK0x3MV
else if Request.ServerVariables("SERVER_NAME")="www.163.com" then8JJ,Ag%\ o y
response.redirect "index3.asp"-n8ND?w-g2C
end if
'^0O&cL]6kj0fB*K end if
"M gZw,Q%u&B end if%>[/code]
M3{ |)~2nsc_ F)wP6b$~oT/m6H
自动打开最快镜像站!L)N2b d;?3O1VU
M(@7s3R|/\ } v"~0X
[[i] 本帖最后由 石头 于 2008-5-25 11:29 编辑 [/i]]

石头 发表于 2008-5-25 11:28

自动打开最快镜像站
loA WL;@ 方案一:
'x6@CRw2hnB R X'l#v.~eY;YrR1`'iu
程序代码:
"u1D)iln6a'd P,y p&|5N0[!u B
[code]<html> +p @j"@+S
<head>
P;lO#E]+B;Z]%`!hU <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312"> 3y;\r-F n1]g
<meta http-equiv="refresh" content="5;url=./"> //设定检测的时间,每5秒刷新一次
$bW O8gb,d B Y <title>自动选择最快站点</title></head>
t2k6y$H-xcVp <center>
(Kw_-\!VGx4Y3} <p>
D+r)fta9DYgR <br> 8D%o+c:ml\;^ [
<font color=blue size=7><br> &wUU!Nn
请稍候,正在选择速度最快站点......</p> ps{Bw'pC
<script>
]q8Us!D-jJ!?'c` i=1
8r |:v#Nx7ec0N&?O var autourl=new Array()
w q"d"hE'F4L;l autourl="http://szyhbcn.xue5.com";
E{ Wx.U0h!Vyi autourl="http://www.qxcomm.com/p_html/szyhbcn";
d jj6nV|/A autourl="http://free.xue5.com/szyhbcn"; //设置三个镜像站点,当然你也可以多加几个只要如上形式即可. v2awJk)j6b^JU8zW
function auto(url) //设置一个自动转向的函数 z7gm7ds Q cn0v
{
Y&IVK$C4{6|-^"J9Y1J%B if(i)
^%y9~z7b r {
!x+}IC u7B9L i=0;
Vc#V2N\&C5G\'CX top.location=url //设置新页面打开的形式
S%J-X/wM,zL/M"m }}
$fm.S v e @W function run() //设置一个启动函数 Q!V@4Sv
{
/L2c&\c0W4Mh'x4zU4y for(var i=1; #Pz i(BG(f
i<autourl.length;i++) //设置一个循环检测,检测最先打开的站点
5N @G ]2^8u*IR document.write("<img src="+autourl+" width=1 height=1 onerror=auto('"+autourl+"')>") //写出具体的链接地址
-U$L$e et4tneU1l } 0V0A.e3_A$Sj-xo
run() //启动函数 &? { k'm MZ8F0t2QH
</script> 9wysks-h*l
</body></html>[/code]B x&N-w:A;SHT6K%H.B

i8~5wW9n mc%Ifv
方案二:
/rld"]|0B4K+Iu a\2^ IO$m~8i
直接将下面代码加入到中
0g9Ax+\C'Y *lb S9q&\_eq;b
程序代码: LYv!k`j7Qf6g
(F I#Ub:V M\
[code]<script>
Q_A\4o|{ i=1 H/`3v d9WFt+D,O

]n1@0g)f6b^4o1IG var autourl=new Array()
Si"E6b1M/F0Ih
L1j^8R}%O-k:Y9o ?)g autourl="szyhbcn.xue5.com" _fg5p&n

Hpo%Xh4j/`+{ N#l autourl="qxcomm.com/p_html/szyhbcn"
:d0P+h*wD 7B E*D|%h4L
autourl="freexue5.com/szyhbcn" .s3U#E,B/h
?8T+gH+~'u7N
function auto(url){if(i){i=0;top.location=url}}
2{1X%C"v^?V5YF
9_;D V*_(r VpI]` function run(){for(var i=1;i<autourl.length;i++)document.write("<img src=http://"+autourl+" width=1 height=1 onerror=auto('http://"+autourl+"')>")} _K6R+kx3N}f
G(O;C2lP8A
run() (q(o t8\{ o\IhakL
</script>[/code]

阿祥 发表于 2008-5-25 11:32

谢谢楼主分享

kzh123 发表于 2008-5-26 08:13

很好,很强悍,谢谢分享

wanleyou 发表于 2008-7-4 15:31

很好,很强悍,谢谢分享

xinhaijiu 发表于 2008-7-4 23:07

没看懂:02: :02: :02:

孤独王子 发表于 2008-7-6 16:51

看不懂哦 ,虽然很好

mmm 发表于 2008-7-6 19:51

顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶

页: [1]

Powered by Discuz! Archiver 6.1.0  © 2001-2007 Comsenz Inc.