用asp腳本實(shí)現(xiàn)限制IP訪(fǎng)問(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今天第一次訪(fǎng)問(wèn)該頁(yè)面"
response.end
else
response.write "此IP以前訪(fǎng)問(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今天第一次訪(fǎng)問(wèn)該頁(yè)面"
response.end
else
response.write "此IP以前訪(fǎng)問(wèn)過(guò)了"
response.end
end if
%>
您可能感興趣的文章:
- ASP.net做的IP訪(fǎng)問(wèn)限制
- 用ASP代碼實(shí)現(xiàn)對(duì)IP的訪(fǎng)問(wèn)限制的代碼
- Asp下實(shí)現(xiàn)限制IP訪(fǎng)問(wèn)的程序代碼
- 推薦的用Asp實(shí)現(xiàn)屏蔽IP地址訪(fǎng)問(wèn)的代碼
- ADSI+ASP添加IP到IIS禁止訪(fǎng)問(wèn)列表中
- 記錄游客頁(yè)面訪(fǎng)問(wèn)IP的簡(jiǎn)易實(shí)現(xiàn)代碼 (asp.net+txt)
- 通過(guò)ASP禁止指定IP和只允許指定IP訪(fǎng)問(wèn)網(wǎng)站的代碼
- Asp限制IP訪(fǎng)問(wèn) 阻止某一個(gè)IP段禁止訪(fǎng)問(wèn)本站的代碼
- asp實(shí)現(xiàn)限制一個(gè)ip只能訪(fǎng)問(wèn)一次的方法
相關(guān)文章
SmartHTTP 簡(jiǎn)易HttpRequest類(lèi)(ASP)
SmartHTTP 簡(jiǎn)易HttpRequest類(lèi)(ASP),需要的朋友可以參考下。2011-03-03
ASP實(shí)現(xiàn)智能搜索實(shí)現(xiàn)代碼
asp下智能搜索功能的實(shí)現(xiàn),方便大家學(xué)習(xí)2008-06-06
asp怎么獲取毫秒數(shù)實(shí)現(xiàn)代碼
得到17位的當(dāng)前時(shí)間如:20091210105237238=2009年12月10日10:52:37:238,接下來(lái)在獲取毫秒數(shù),感興趣的朋友可以參考下哈,希望可以幫助到你2013-04-04
在asp中使用js的encodeURIComponent方法
encodeURIComponent 方法返回一個(gè)已編碼的 URI。如果您將編碼結(jié)果傳遞給 decodeURIComponent,那么將返回初始的字符串2012-03-03
asp下實(shí)現(xiàn)代碼的“運(yùn)行代碼”“復(fù)制代碼”“保存代碼”功能源碼
下面的代碼是通過(guò)字符替換的方法,不是正則表達(dá)式2008-12-12
ASPWebPack(整站文件備份系統(tǒng)) v1.0.2 黑客也用
ASPWebPack(整站文件備份系統(tǒng)) v1.0.2 黑客也用...2007-10-10
基于A(yíng)SP實(shí)現(xiàn)QQ在線(xiàn)查詢(xún)功能
這篇文章給大家介紹使用asp實(shí)現(xiàn)qq在線(xiàn)查詢(xún)功能,涉及到的知識(shí)點(diǎn)有xmlhttp讀取騰訊網(wǎng)站相應(yīng)的html代碼獲取qq頭像。對(duì)qq在線(xiàn)查詢(xún)感興趣的朋友可以參考下本篇文章2015-10-10

