⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cnbbr_iplock.asp

📁 . 缓存处理技术
💻 ASP
字号:
<!--#include file="sysconfig.Asp"-->
<!--#include file="checkadmin.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<BODY leftmargin="0" bottommargin="0" rightmargin="0" topmargin="0" marginheight="0" marginwidth="0" bgcolor="#DDEEFF">

<%
With ReSponse
  .Write"<table width=98% border=0 align=center cellpadding=0 cellspacing=0>"& vbcrlf
  .Write" <tr> "& vbcrlf
  .Write"	 <td colspan=2 width=100% align=center height=2 class=menutdbg_1></td> "& vbcrlf
  .Write"	</tr> "& vbcrlf
  .Write" <tr height=32> "& vbcrlf
  .Write"  <td width=100% colspan=2 background=""../Skins/"& SKINS_FOLDER &"/GrayBg.gif"">&nbsp;<img src=""../Skins/"& Skins_Folder &"/Go.gif"" border=""0""><a href=""help.asp"" class=menuColor_1><b>后台管理</b></a>&gt;&gt;&gt; <a href=""Cnbbr_IpLock.asp"" class=menuColor_1><b>IP地址过滤设置</b></a> </td>"& vbcrlf
  .Write"  </tr>"& vbcrlf
  .Write"</table>" & Vbcrlf
End With

Dim GetBack2,Boolbase
GetBack2="<a href='Cnbbr_IpLock.Asp'><div align=center><b>返回IP锁定管理页面</b></div></a>"
Dim Talers
sql="select boolbase from Cnbbr_IpLockFlag"
Set Talers=server.createobject("adodb.recordset")
Talers.open sql,Conn,1,1
	if not(Talers.bof and Talers.eof) then
	   Boolbase=split(talers("boolbase"),"|")
	End if
Talers.close
Set Talers=nothing
Sub Erasearraybase()
Erase boolbase
End Sub
%>
<table width="96%" border=0 align=center cellpadding=1 cellspacing=1 class="tablebg">
<%
Call DoNoCnbbr_IpLock
Dim Operate
Operate=Trim(Request("operate"))
If Operate="del" Then
	DelLock
ElseIf Operate="save" Then
	Call SaveLock
Else
	Call LockList
End if
Response.Write "</table>"

Sub Locklist
Set Talers=Conn.ExeCute("Select * from Cnbbr_IpLock order by ipid desc")
If Not Talers.Eof Then
i=0
%>
<tr class="titletd">
<td align=center width="10%"><font color='#ffffff'><b>ID<b></font></td>
<td align=center width="20%"><font color='#ffffff'><b>被锁IP<b></font></td>
<td align=center width="40%"><font color='#ffffff'><b>说明原因<b></font></td>
<td align=center width="20%"><font color='#ffffff'><b>封锁时间<b></font></td>
<td align=center width="10%"><font color='#ffffff'><b>删除IP <b></font></td>
</tr>
<%
Do while Not Talers.eof
i=i+1
Dim WhyCnbbr_IpLock
WhyCnbbr_IpLock=split(TaleRS("IpLock"),"|")
%>
<tr bgColor="#e8e8e8" onmouseover="this.bgColor='#f3f3f3';" onmouseout="this.bgColor='#e8e8e8';">
<td align=center><%=i%></td>
<td align=center><%=RealLock(Talers("ipsame"),Talers("ip1"),Talers("ip2"),Talers("ip3"),Talers("ip4"))%></td>
<td align=center><%=WhyCnbbr_IpLock(1)%></td>
<td align=center><%=WhyCnbbr_IpLock(0)%></td>
<td align=center><a href='Cnbbr_IpLock.Asp?operate=del&ipid=<%=Talers("ipid")%>'>删除</a></td>
</tr>
<%
Talers.Movenext
Loop 
Else
Response.Write"<tr><td bgcolor=#F7F7F7 align=center height=40 colspan=10><font color=#Cc0000>目前没有IP封锁的记录</font></td></tr>"
End If
Talers.Close
Set Talers=Nothing
Call  LockAdd
End Sub

Sub SaveLock
Call CheckAdminFlag(TempAdminFlag,2)
DIm IPArr(3)
For i=0 to 3 
IPArr(i)=Trim(request.form("ip"&i+1&""))
If IpArr(i)="" Or IsNumeric(IpArr(i))=False Then 
	response.write ("<div align=center><BR><BR><font color=#Cc0000><b>错误提示:第"&i+1&"段必须数字</b></font></div>")
	response.write ("<BR><BR>"&GetBack2)
	Exit Sub
End If
Next
Conn.Execute("insert into Cnbbr_IpLock (ip1,ip2,ip3,ip4,ipsame,IpLock) values ("&Cint(IPArr(0))&","&Cint(IPArr(1))&","&Cint(IPArr(2))&","&Cint(IPArr(3))&","&Cint(Request.Form("ipsame"))&",'"&Now&"|"&Request.form("reason")&"')")
BoolBase(0)=1
Conn.ExeCute("Update Cnbbr_IpLockFlag set Boolbase='"&Join(BoolBase,"|")&"'")
response.write ("<div align=center><BR><BR><font color=#Cc0000><b>操作提示:IP地址 "&RealLock(Cint(Request.Form("ipsame")),iparr(0),iparr(1),iparr(2),iparr(3))&" 已被锁定!</b></font></div>")
response.write ("<BR><BR>"&GetBack2)
End Sub

Function RealLock(IPsame,Ip1,ip2,ip3,ip4)
IF IPsame=1 Then
	RealLock="<font color='#cc0000'><b>"&IP1&".*.*.*</b></font>"
ElseIF IPsame=2 Then
	RealLock="<font color='#cc0000'><b>"&IP1&"."&IP2&".*.*</b></font>"
ElseIF IPsame=3 Then
	RealLock="<font color='#cc0000'><b>"&IP1&"."&IP2&"."&IP3&".*</b></font>"
ElseIF IPsame=4 Then
	RealLock="<font color='#cc0000'><b>"&IP1&"."&IP2&"."&IP3&"."&IP4&"</b></font>"
End IF
End Function

Sub DelLock
	Call CheckAdminFlag(TempAdminFlag,3)
	Conn.Execute("Delete * from Cnbbr_IpLock where ipid="&Cint(Request("ipid"))&"")
	response.write ("<div align=center><BR><BR><font color=#Cc0000><b>操作提示:IP已被删除!</b></font></div>")
	response.write ("<BR><BR>"&GetBack2)	
End Sub

Sub DoNoCnbbr_IpLock()
Set Talers=Conn.Execute("select top 1 ipid from Cnbbr_IpLock")
	If Talers.Eof Then
		BoolBase(0)=0
		Conn.ExeCute("Update Cnbbr_IpLockFlag set Boolbase='"&Join(BoolBase,"|")&"'")
	End If
Talers.Close
Set Talers=Nothing
End Sub
%>
</table>
<%
Sub LockAdd
%>
<table width=96% cellpadding=0 cellspacing=1 border=0 align=center>
<form method=post action='Cnbbr_IpLock.Asp?operate=save'>
  <tr>
   <td align=center>&nbsp;</td>
  </tr>
  <tr>
   <td width=100% align=center>

<table width=100% cellpadding=0 cellspacing=1 border=0 align=center class=tablebg>
<tr>
<td align=center colspan=2 class=titletd>IP地址过滤设置</td>
</tr>
<tr class=td>
<td align=right width="30%">IP地址:</td>
<td>
<input name=ip1 style="width:50" maxlength=3>&nbsp;.&nbsp;
<input name=ip2 style="width:50" maxlength=3>&nbsp;.&nbsp;
<input name=ip3 style="width:50" maxlength=3>&nbsp;.&nbsp;
<input name=ip4 style="width:50" maxlength=3>
</td>
</tr>
<tr class=td>
<td align=right>IP段数:</td>
<td>
<select name=ipsame>
<%
For i=1  to  4 
Response.write"<option value="&i&" "
If i=4 Then Response.write" Selected "
Response.write">前 "&i&" 段相同</option>"
Next
%>
</select>
</td>
</tr>
<tr class=td>
<td align=right>原因说明:</td>
<td>
<input name="reason" style="width:300">
</td>
</tr>
<tr height=38 class=td>
<td Colspan=2 align=center><input type=submit value="封锁指定IP地址" style="background: #DFDFEF">&nbsp;<INPUT type=reset value=" 重写 " style="background: #DFDFEF"></td>
</tr>
</table>

   </td>
  </tr>
</form>
</table>
<%
End Sub
%>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -