Python语言技术文档

微信小程序技术文档

php语言技术文档

jsp语言技术文档

asp语言技术文档

C#/.NET语言技术文档

html5/css技术文档

javascript

点击排行

您现在的位置:首页 > 技术文档 > asp技巧

用asp脚本实现限制IP访问

来源:中文源码网    浏览:359 次    日期:2024-04-14 14:30:11
【下载文档:  用asp脚本实现限制IP访问.txt 】


用asp脚本实现限制IP访问
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 %>

相关内容