根据本地网站客户端ip 判断其在表VIEWIP中属于四个区域的哪个区域,然后网页跳转到相应区域的页面
时间:2010-05-25
来源:互联网
请大家帮忙看看怎么写 谢谢!
VIEWIP (IP区域段表)
------------------------------------------------------------------
View_id View_name View_IP_from View_IP_to
1 北京 10.77.147.128 10.77.147.191
2 上海 10.77.144.0 10.77.147.127
3 广东 10.77.147.192 255.255.255.255
4 辽宁 10.77.192.0 10.77.192.255
想要实现的功能:
<%
getIP=获得客户端ip
if getIP 在 北京IP段组(10.77.147.128<getIP<10.77.147.191) then
response.Redirect("beijing.asp")
end if
if getIP 在 上海IP段组 then
response.Redirect("shanghai.asp")
end if
if getIP 在 广东IP段组 then
response.Redirect("guangdong.asp")
end if
if getIP 在 辽宁IP段组 then
response.Redirect("liaoning.asp")
end if
%>
VIEWIP (IP区域段表)
------------------------------------------------------------------
View_id View_name View_IP_from View_IP_to
1 北京 10.77.147.128 10.77.147.191
2 上海 10.77.144.0 10.77.147.127
3 广东 10.77.147.192 255.255.255.255
4 辽宁 10.77.192.0 10.77.192.255
想要实现的功能:
<%
getIP=获得客户端ip
if getIP 在 北京IP段组(10.77.147.128<getIP<10.77.147.191) then
response.Redirect("beijing.asp")
end if
if getIP 在 上海IP段组 then
response.Redirect("shanghai.asp")
end if
if getIP 在 广东IP段组 then
response.Redirect("guangdong.asp")
end if
if getIP 在 辽宁IP段组 then
response.Redirect("liaoning.asp")
end if
%>
作者: helloidea 发布时间: 2010-05-25
飘过`~
作者: wangxiaomo521 发布时间: 2010-05-26
例子:
HTML code
HTML code
<% Function FormatIP(IP) IP=Split(IP,".") FormatIP=Cint(IP(0))*256*256*256+Cint(IP(1))*256*256+Cint(IP(2))*256+Cint(IP(3))-1 End Function Dim getIP,Url getIP=FormatIP("10.77.147.182") '假设客户端IP是10.77.147.182 If FormatIP("10.77.147.128")<getIP And getIP<FormatIP("10.77.147.191") Then Url="beijing.asp" ElseIf FormatIP("10.77.144.0")<getIP And getIP<FormatIP("10.77.147.127") Then Url="shanghai.asp" ElseIf FormatIP("10.77.147.192")<getIP And getIP<FormatIP("255.255.255.255") Then Url="guangdong.asp" ElseIf FormatIP("10.77.192.0")<getIP And getIP<FormatIP("10.77.192.255") Then Url="liaoning.asp" End If If Url<>"" Then Response.Redirect(Url) %>
作者: liaitan 发布时间: 2010-05-26
MARK!
作者: hubing2008 发布时间: 2011-12-19
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28