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
%>
<%
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脚本实现限制IP访问
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
桃源资源网 Design By www.nqtax.com
暂无“用asp脚本实现限制IP访问”评论...