Asp实现禁止IP访问代码
作者:admin 日期:2011-10-19
function banip(ip)
banips="221.204.*.*|118.74.*.*"
str=split(banips,"|")
ipstr=split(ip,".")
for i=lbound(str) to ubound(str)
ban=true
str2=split(str(i),".")
for j=lbound(str2) to ubound(str2)
if str2(j)<>ipstr(j) and str2(j)<>"*" then
ban=false
end if
next
if ban=true then
banip=ban
exit function
end if
next
end function
使用示例:
ip="59.49.78.57"
if banip(ip)=true then
response.Write("IP被禁止访问!")
response.End()
end if
www.tianzhigang.com原创代码,转载请注明出处!
下一篇: GoDaddy空间运行asp无组件上传问题
文章来自: 本站原创
引用通告: 查看所有引用 | 我要引用此文章
Tags: asp
相关日志:
广告位