最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

asp 根據(jù)IP地址自動(dòng)判斷轉(zhuǎn)向分站的代碼

 更新時(shí)間:2008年11月27日 00:48:16   作者:  
根據(jù)IP地址自動(dòng)判斷轉(zhuǎn)向分站的代碼 這個(gè)是一個(gè)不錯(cuò)的解決之道,可以緩解服務(wù)器壓力過(guò)大等一些問(wèn)題
Function getIpvalue(clientIP)'得到客戶端的IP轉(zhuǎn)換成長(zhǎng)整型,返回值getIpvalue
On Error Resume Next
Dim strIp, array_Ip
strIp=0
array_Ip = Split(clientIP,".")
If UBound(array_Ip)<>3 Then
getIpvalue=0
Exit Function
End If
For i=0 To 3
strIp=strIp+(CInt(array_Ip(i))*(256^(3-i)))
Next
getIpvalue=strIp
If Err Then getIpvalue=0
End Function
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)
If RsIp.bof and RsIp.eof then
UrlCity="未知"
Else
UrlCity=RsIp.Fields.Item("City").Value
End If
if instr(UrlCity,"廣州")<>0 then
response.Redirect("http://www.fzitv.net")
end if
if instr(UrlCity,"深圳")<>0 then
response.Redirect("http://img.jb51.net")
end if
if instr(UrlCity,"上海")<>0 then
response.Redirect("http://xiazai.jb51.net")
end if
所用到的IP數(shù)據(jù)庫(kù)可以去網(wǎng)上down一個(gè)回來(lái)

相關(guān)文章

最新評(píng)論

贵州省| 同心县| 威信县| 五寨县| 衡阳县| 宝应县| 永宁县| 潜江市| 嫩江县| 大竹县| 长乐市| 银川市| 巴彦淖尔市| 永安市| 和龙市| 江城| 嵩明县| 双城市| 余干县| 普洱| 张家港市| 舟曲县| 丰县| 夏津县| 三江| 桂东县| 天柱县| 凤庆县| 闸北区| 洛阳市| 乌海市| 巴林左旗| 和硕县| 安泽县| 乌鲁木齐县| 航空| 平陆县| 来安县| 嫩江县| 布拖县| 民权县|