根据IP地址自动判断转向分站的代码
Function getIpvalue(clientIP) '得到客户端 的IP转换成长整型,返回值getIpvalueOn Error Resume Next#z;Yv]b9AiKLx]
Dim strIp, array_Ip
strIp=0
array_Ip = Split(clientIP,".")SA5aUR.E
If UBound(array_Ip)<>3 Then
getIpvalue=0
Exit FunctionW+Mcy1i#m$R8@@3e
End If%R [ i,N3ph7g
For i=0 To 3
strIp=strIp+(CInt(array_Ip(i))*(256^(3-i)))zC$dRZ)N&iD
Next
getIpvalue=strIp
If Err Then getIpvalue=0
End Function&U[:fW4Jg?
i.Fc@0c'Pg
,{ g$^Qw1z
clientIP=request.ServerVariables("REMOTE_HOST")
IpValue=getIpvalue(clientIP)
strSql="select top 1 City from [Ipaddress] where "&IpValue&" between Ip1 and Ip2"
Set RsIp=conn.execute(strSql)L(a,U|"CM| } g
If RsIp.bof and RsIp.eof then*R&K!a"|y7R&[0RX
UrlCity="未知"8v+U ?Sz/} _'L-c fe
ElseB!Sq o3L(q
UrlCity=RsIp.Fields.Item("City").Value"E's)F'[ zz(FE?sq
End IfI Y-Z+O`MW
if instr(UrlCity,"广州")<>0 then response.Redirect("http://guangzhou.youname.com")KJ'h#KqQ Dy+Q"C
if instr(UrlCity,"深圳")<>0 then response.Redirect("http://shenzhen.youname.com")r6["s,yf3D0Mt&^z
if instr(UrlCity,"上海")<>0 then response.Redirect("http://shanghai.youname.com")6e2S4w1V"MP"LG
,IP库网上很多,上面只是其中一种方法.
P.H6p9b6X|N]
以前用过的,,
附件为演示 支持一个啊 呵呵 路过
支持一下
特价啦!!赶快抢购阿!!! 感谢236z论坛给予的发言机会!
草根站长论坛's Archiver