网络编程 
首页 > 网络编程 > 浏览文章

用asp脚本实现限制IP访问

(编辑:jimmy 日期: 2024/9/22 浏览:3 次 )
cookies跨不了域很麻烦,有了这个脚本就方便多了.
<%
ip=Request.ServerVariables("REMOTE_ADDR")
set Fso=CreateObject("Scripting.FileSystemObject")
Set Files=Fso.OpenTextFile(server.mappath("./ip.txt"),1,false)
data=files.readall
files.close
set fso=nothing
if InstrRev(data, ip, -1, 0) = 0 then
    set Fso=CreateObject("Scripting.FileSystemObject")
    Set File=Fso.OpenTextFile(server.mappath("./ip.txt"),8,true)
    file.writeline ip
    file.close
    set fso=nothing
    response.write "此IP今天第一次访问该页面"
    response.end
else
    response.write "此IP以前访问过了"
    response.end
end if
%> 
上一篇:如何写ASP入库小偷程序
下一篇:关于无限分级(ASP+数据库+JS)的实现代码
一句话新闻
Windows上运行安卓你用过了吗
在去年的5月23日,借助Intel Bridge Technology以及Intel Celadon两项技术的驱动,Intel为PC用户带来了Android On Windows(AOW)平台,并携手国内软件公司腾讯共同推出了腾讯应用宝电脑版,将Windows与安卓两大生态进行了融合,PC的使用体验随即被带入到了一个全新的阶段。
友情链接:杰晶网络 DDR爱好者之家 南强小屋 黑松山资源网 白云城资源网 SiteMap