实现根据教育网IP/公网IP进行不同服务器转向(学习)

场景:提高公网、教育网用户个自的访问速度,公网用户使用公网服务器、教育网用户使用教育网服务器。
解决办法(从来没整个asp,花了2个小时查资料,整出这么一东西):

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title>
</head>
<body>
    <%  = Request.ServerVariables("REMOTE_ADDR") %>
    <% ip = Request.ServerVariables("REMOTE_ADDR")

       set conn=Server.createobject("ADODB.CONNECTION")      '创建连接对象  
           conn.Provider="Microsoft.Jet.OLEDB.4.0"
           conn.Open "C:\Inetpub\wwwroot\EduIP.mdb"

       set rs=Server.CreateObject("ADODB.recordset")
           sql = "select ipaddress from tbi_eduip where ipaddress like'"+ip+"%'"
           rs.Open sql,conn,1,1

       if (rs.RecordCount >0) then
           response.Redirect("http://www.google.cn/")
       else
           response.Redirect("http://www.baidu.com/")
       end if

       conn.Close
    %>
</body>
</html>

原文地址:https://www.cnblogs.com/spymaster/p/1495997.html