我是靠谱客的博主 清秀耳机,这篇文章主要介绍用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
%> 

最后

以上就是清秀耳机最近收集整理的关于用asp脚本实现限制IP访问的全部内容,更多相关用asp脚本实现限制IP访问内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(117)

评论列表共有 0 条评论

立即
投稿
返回
顶部