Fonction getIpvalue(clientIP) 'si vous avez besoin d'une adresse IP pour obtenir un getIpvalue
En cas d'erreur, reprendre ensuite
Dim strIp, array_Ip
strIp=0
array_Ip = Split(clientIP,".")
Si UBound(array_Ip)<>3 Alors
getIpvalue=0
Fonction de sortie
Fin si
Pour i=0 à 3
strIp=strIp+(CInt(array_Ip(i))*(256^(3-i)))
Suivant
getIpvalue=strIp
Si Err Alors getIpvalue=0
Fonction de fin
clientIP=request.ServerVariables("REMOTE_HOST")
IpValue=getIpvalue(clientIP)
strSql="sélectionnez la première ville de [Ipaddress] où "&IpValue&" entre Ip1 et Ip2"
Définir RsIp=conn.execute(strSql)
Si RsIp.bof et RsIp.eof alors
UrlCity="未知"
Autre
UrlCity=RsIp.Fields.Item("Ville").Valeur
Fin Si
if instr(UrlCity,"广州")<>0 then réponse.Redirect(" http://code.knowsky.com ")
si instr(UrlCity,"深圳")<>0 alors réponse.Redirect(" http://moban.knowsky.com ")
if instr(UrlCity,"上海")<>0 then réponse.Redirect(" http://font.knowsky.com ")
由于IP库超过1M,所以上传不了,IP库网上很多,code.knowsky.com 就有下载。上面只是其中一种方法.