用asp腳本實(shí)現(xiàn)限制IP訪問(wèn)
更新時(shí)間:2007年06月06日 00:00:00 作者:
cookies跨不了域很麻煩,有了這個(gè)腳本就方便多了.
<%
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今天第一次訪問(wèn)該頁(yè)面"
response.end
else
response.write "此IP以前訪問(wèn)過(guò)了"
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今天第一次訪問(wèn)該頁(yè)面"
response.end
else
response.write "此IP以前訪問(wèn)過(guò)了"
response.end
end if
%>
您可能感興趣的文章:
- ASP.net做的IP訪問(wèn)限制
- 用ASP代碼實(shí)現(xiàn)對(duì)IP的訪問(wèn)限制的代碼
- Asp下實(shí)現(xiàn)限制IP訪問(wèn)的程序代碼
- 推薦的用Asp實(shí)現(xiàn)屏蔽IP地址訪問(wèn)的代碼
- ADSI+ASP添加IP到IIS禁止訪問(wèn)列表中
- 記錄游客頁(yè)面訪問(wèn)IP的簡(jiǎn)易實(shí)現(xiàn)代碼 (asp.net+txt)
- 通過(guò)ASP禁止指定IP和只允許指定IP訪問(wèn)網(wǎng)站的代碼
- Asp限制IP訪問(wèn) 阻止某一個(gè)IP段禁止訪問(wèn)本站的代碼
- asp實(shí)現(xiàn)限制一個(gè)ip只能訪問(wèn)一次的方法
相關(guān)文章
Session.TimeOut的最大取值是1440,超出會(huì)報(bào)錯(cuò)
Session.TimeOut的取值以分鐘為單位,最大取值是1440分鐘,也就是24個(gè)小時(shí),如果給它賦一個(gè)更大的值2009-06-06ASPWebPack(整站文件備份系統(tǒng)) v1.0.2 黑客也用
ASPWebPack(整站文件備份系統(tǒng)) v1.0.2 黑客也用...2007-10-10asp 實(shí)現(xiàn)顯示所有的服務(wù)器變量值的函數(shù)
asp 實(shí)現(xiàn)顯示所有的服務(wù)器變量值的函數(shù)...2007-08-08asp獲取當(dāng)前完整路徑(url)的函數(shù)代碼
這篇文章主要介紹了asp獲取當(dāng)前完整路徑(url)的函數(shù)代碼,有時(shí)候我么您需要獲取網(wǎng)址,端口、路徑文件名、參數(shù)等,這里就為大家分享一下這個(gè)函數(shù)代碼,需要的朋友可以參考下2020-02-02ASP中通過(guò)該日歷算法實(shí)現(xiàn)的具體代碼
ASP中通過(guò)該日歷算法實(shí)現(xiàn)的具體代碼...2006-08-08asp中用insert into語(yǔ)句向數(shù)據(jù)庫(kù)插入記錄(添加信息)的方法
asp中用insert into語(yǔ)句向數(shù)據(jù)庫(kù)插入記錄信息的方法,學(xué)習(xí)的朋友可以參考下。2010-09-09