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

📄 iplock.asp

📁 个人网站系统,本人基于第三方源码进行更改!
💻 ASP
字号:
<!--#Include file="../Common/Inc_DatConn.asp"-->
<!--#Include file="Common/Inc_Config.asp"-->
<!--#Include file="Common/Inc_Function.asp"-->
<%
'┌─  风云ASP在线  ────────────────────────┐
'│                                                                 │
'│  作者:赵振波.	http://www.fyasp.com	    				    │
'│                                                                 │
'│   Q Q:176189168  										   	    │
'│                                                                 │
'│ Email:fy96@163.com                                             │
'│                                                                 │
'│ 程序定做,系统开发,网站制作,提供高质量的网络产品、技术和服务!│
'│                                                                 │
'│【版权声明】                                                     │
'│                                                                 │
'│     本程序版权归坐看风云所有,未经授权擅自修改、复制或散布本程序│
'│                                                                 │
'│的部分或全部,将承受严厉的民事和刑事处罚,对已知的违反者将给予法 │
'│                                                                 │
'│律范围内的全面制裁。对非法使用此程序所造成的一切后果本人概不负责!│
'│                                                                 │
'└───────────────────  http://www.fyasp.com ──┘
%>
<%if IsTimeOut(Session("strAccount"),Session("strPassWord")) then Response.Redirect "index.asp"%>
<html>
<head>
<title><% = strSiteName%> - 网站后台管理系统</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="Common/Site.css" type="text/css">
</head>

<body leftMargin="0" topMargin="2">
<%
Dim GetBack2
GetBack2="<a href='IpLock.Asp'><div align=center><font size=1><b>返回锁定IP管理页面</b></font></div></a>"

Talesql="select boolbase from IpLockFlag"
Set Talers=server.createobject("adodb.recordset")
Talers.open Talesql,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
%>
<!--#Include file="Common/inc_Top.asp"-->
<table width="750" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr> 
    <td width="105" valign="top" style="border-left: 1px solid rgb(0,0,0); border-right: 1px solid rgb(0,0,0)" class="bottom"><br>
	<!--#Include file="Common/Inc_Button.asp"-->
    </td>
    <td valign="top" style="border-right: 1px solid rgb(0,0,0)" align="center">
<table width="90%" border=0 align=center cellpadding=1 cellspacing=1 class="maintable">
<tr>
<td height=10 colspan=10></td>
</tr>
<%
Call DoNoIpLock
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 IpLock order by ipid desc")
If Not Talers.Eof Then
i=0
%>
<tr bgcolor='#396ba5'>
<td align=center width=120 bgcolor="#9BB375"><b><font color='#ffffff'>ID</font></td>
<td align=center width=200 bgcolor="#9BB375"><b><font color='#ffffff'>被锁IP</font></td>
<td align=center width=330 bgcolor="#9BB375"><b><font color='#ffffff'>说明原因</font></td>
<td align=center width=100 bgcolor="#9BB375"><b><font color='#ffffff'>删除IP </font></td>
</tr>
<%
Do while Not Talers.eof
i=i+1
Dim WhyIpLock
WhyIpLock=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><%=WhyIPLOck(1)%></td>
<td align=center><a href='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 size=5 color=#Cc0000>目前没有IP封锁的记录</font></td></tr>"
End If
Talers.Close
Set Talers=Nothing
Call  LockAdd
End Sub

Sub LockAdd
%>
<form method=post action='IpLock.Asp?operate=save'>
<tr>
<td align=right colspan=2>IP地址:</td>
<td Colspan=6>
<input name=ip1 style="width:50">&nbsp;.&nbsp;
<input name=ip2 style="width:50">&nbsp;.&nbsp;
<input name=ip3 style="width:50">&nbsp;.&nbsp;
<input name=ip4 style="width:50">
</td>
<tr>
<td align=right colspan=2>IP段数:</td>
<td Colspan=6>
<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>
<td align=right colspan=2>原因说明:</td>
<td Colspan=6>
<input name="reason" style="width:300">
</td>
</tr>
<tr>
<td Colspan=10 align=center><input type=submit value="对上面的IP地址封锁">&nbsp;<INPUT type=reset value=" 擦除重填 "></td>
</tr>
</form>

<%
End Sub
Sub SaveLock
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 size=5 color=#Cc0000><b>错误提示:第"&i+1&"段必须数字</b></font></div>")
	response.write ("<BR><BR>"&GetBack2)
	Exit Sub
End If
Next
Conn.Execute("insert into 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 IpLockFlag set Boolbase='"&Join(BoolBase,"|")&"'")
response.write ("<div align=center><BR><BR><font size=5 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
	Conn.Execute("Delete * from IpLock where ipid="&Cint(Request("ipid"))&"")
	response.write ("<div align=center><BR><BR><font size=5 color=#Cc0000><b>操作提示:IP已被删除!</b></font></div>")
	response.write ("<BR><BR>"&GetBack2)	
End Sub

Sub DoNoIpLock()
Set Talers=Conn.Execute("select top 1 ipid from IpLock")
	If Talers.Eof Then
		BoolBase(0)=0
		Conn.ExeCute("Update IpLockFlag set Boolbase='"&Join(BoolBase,"|")&"'")
	End If
Talers.Close
Set Talers=Nothing
End Sub
%>
</table></td>
  </tr>
</table>
<!--#Include file="Common/Inc_Bottom.asp"-->
</body>
</html>

⌨️ 快捷键说明

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