国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > ASP > 正文

asp 根據IP地址自動判斷轉向分站的代碼

2024-05-04 11:00:30
字體:
來源:轉載
供稿:網友
Function getIpvalue(clientIP)'得到客戶端的IP轉換成長整型,返回值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://m.survivalescaperooms.com")
end if
if instr(UrlCity,"深圳")<>0 then
response.Redirect("http://img.Vevb.com")
end if
if instr(UrlCity,"上海")<>0 then
response.Redirect("http://xiazai.Vevb.com")
end if
所用到的IP數據庫可以去網上down一個回來
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 资源县| 靖宇县| 汝城县| 长岛县| 南宁市| 嵊泗县| 景谷| 灵宝市| 读书| 宜都市| 丹凤县| 西畴县| 衢州市| 北京市| 澄迈县| 秀山| 鸡泽县| 白玉县| 清水河县| 南岸区| 新余市| 东辽县| 贡山| 土默特右旗| 孝感市| 宁陕县| 蛟河市| 沅江市| 蓬溪县| 格尔木市| 吉隆县| 武清区| 马鞍山市| 蓬莱市| 通州市| 安福县| 玉门市| 海南省| 漯河市| 潼关县| 城步|