网通电信IP选择跳转网站

下面代码用ASP来实现,对不同网络接入商的跳转!

<%
'版权归auuo.com所有
On Error Resume next
dim conn,dbpath,UserIP
set conn=server.createobject("adodb.connection")
DBPath = Server.MapPath("IP.mdb")
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & DBPath
If Err Then
  err.Clear
  Set Conn = Nothing
  Response.Write "数据库正在更新中,请稍后再试!"'
  Response.End
End If
myip = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If myip = "" Then myip = Request.ServerVariables("REMOTE_ADDR")
tempip=myip
myip = Split(myip,".")
if Ubound(myip)=3 then
For i=0 To Ubound(myip)
myip(i)=left(myip(i),3)
if isnumeric(myip(i)) then
 myip(i)=cint(myip(i))
else
 myip(i)=0
end if
next
myipnumeber=myip(0)*256*256*256+myip(1)*256*256+myip(2)*256+myip(3)
sql="select city from IP where startip<="&myipnumeber&" and endip>="&myipnumeber
set rs1=conn.execute(sql)
if not rs1.eof then
response.redirect "http://auuo.com" '是网通的话则跳转到网通的网址去,自己修改为自己的网站
Else
response.redirect "http://www.auuo.com" '不是网通的则跳转到的网址,自己修改,不废话了
end if
rs1.close
set rs1=nothing
conn.close
set conn=nothing
end if%>

联系我们

QQ:51193930(Ahoo)
MSN:auuocx@hotmail.com
网址:http://www.auuo.com
地址:慈溪天九商务中心525室
电话:189-0662-0882

我们的优势
拥有优秀的网站设计师与程序工程师,精通各种一流的图形设计软件,如Photoshop、Freehand CorlDraw、Flash、Dreamweaver、Fireworks等等制作网页和平面设计图。以及使用C语言、C#、ASP.NET框架、asp、php等语言为您开发项目,我们为您准备了最专业的技术服务。为您开发的网站精致实用,代码清晰,保证您的网站安全可靠修改方便,最重要的是符合市场需求,并随时为客户解决各种技术问题。

我们正在努力开拓...

baidu

互联网 本网站