添加收藏
 系统管理
 联系方式
  汉南在线网页设计Asp动态程序

IP转换成数字
作  者:汉南居士
关键字:ASP技术应用



IP转换成数字,限制IP时用

'//IP转换成数字,限制IP时用
'@使用示例
'// userIPnum = IP2Num(Request.ServerVariables("REMOTE_ADDR"))
'// if userIPnum > IP2Num("192.168.0.0") and userIPnum < IP2Num("192.168.0.255") then
'// response.write ("<center>您的IP被禁止</center>")
'// response.end'
// end if

function IP2Num(sip)
dim str1,str2,str3,str4
dim num IP2Num=0
if isnumeric(left(sip,2)) then
str1=left(sip,instr(sip,".")-1)
sip=mid(sip,instr(sip,".")+1)
str2=left(sip,instr(sip,".")-1)
sip=mid(sip,instr(sip,".")+1)
str3=left(sip,instr(sip,".")-1)
str4=mid(sip,instr(sip,".")+1)
num=cint(str1)*256*256*256+cint(str2)*256*256+cint(str3)*256+cint(str4)-1
IP2Num = num
end if
end function



来源:互联网
阅读:431
日期:2005-12-24

【 双击滚屏 】 【 推荐朋友 】 【 收藏 】 【 打印 】 【 关闭 】 【 字体: 】 
上一篇:圣诞祝福短信大集锦
下一篇:网页布局理念

  >> 相关文章
 
  ·在ASP中操作word
  ·几个经典的ASP应用(1)
  ·ASP Function在程序中的使用
  ·用ASP制作多个域名绑定一个空间的页面
  ·asp作品保护方案
  ·ASP分页函数

5.12汶川大地震遇难同胞默哀 | 汉南在线总站 | 网站建设 | BT电影下载 | 汉南在线博客 | 流行购商城

授权使用:汉南在线 http://hnzx.hzwz.net/
经营许可证:陕ICP备05000109号 Powered by:汉南在线  
Copyright (c) 2002-2008 汉南在线. All Rights Reserved .