欧美性猛交黑人xxxx,成人毛片一区二区三区,久久综合九色综合精品,男的把j放进女人下面视频免费

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

  • 發布于:2020-04-20
  • 252 人圍觀
為了讓客戶端更快速的訪問網站,通常一個大型網站會有許多分站,所以讓客戶端訪問相應的分站,會讓客戶有更好的體驗,這就要用到根據客戶端IP地址轉向不同的分站。這里面要用到IP數據庫,可到網上去下載。IP數據庫在此主要用途是根據得到的IP,找到此IP所在的地址。
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://code.nianer.com")
end if
if instr(UrlCity,"深圳")<>0 then 
   response.Redirect("http://moban.nianer.com")
end if
if instr(UrlCity,"上海")<>0 then 
   response.Redirect("http://font.nianer.com")
end if

萬企互聯
標簽: