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

📄 ipgl.asp

📁 柠檬树聊天服务器
💻 ASP
字号:
<%@ LANGUAGE="VBSCRIPT" %>
<%Response.Expires=0%>
<!--#include file="conn.asp"-->
<!--#include file="adovbs.inc" --->
<html>
<head>
<title>IP管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
body {font-size : 9pt;}
td {font-size : 9pt;}
input {font-size : 9pt;}
.p10 {font-size: 10.5pt;}
A  {color:#blue;text-decoration : none;}
A:Hover  {color:red;text-decoration:none;}
A:Active  {color:black}
-->
</style>
</head>
<body oncontextmenu=self.event.returnValue=false bgcolor="#FFFFFF" topMargin=20>
<form method="post" action="ipgl.asp">
<% Dim lockip,manage,class1,name,lock,lockname
manage=Session("usernickname")
class1=Session("class")
if manage="" then Response.Write "没有权限" : Response.end
manage="<font color=red>"&manage&"</font>"
ip=Request.QueryString("ip")
lock=Request.QueryString("lock")
lockname="<font color=red>"&name&"</font>"
lockip=Request.Form("lockip")
s=Hour(time())
f=Minute(time())

IF lock<>"" then   
   if lock="1" then
      Set rs = Conn.Execute("Delete * from ip where ip='"&ip&"'")
      detail=manage& " 为 "&lockname&" 解锁IP<br><font color=a22255> [原因:] </font>"
   else
      Set rs = Conn.Execute( "update ip set lock='1' where ip='"&ip&"'" )
   end if
 rs.close
 Response.write "<br><br><br><br><br><p align='center'>操作已记入聊务公开。<br><br>"&detail&"</p>"
 Response.write "<p align='center'><a href='ipgl.asp'>点击这里返回</a></p></body>"
 Response.end
Else

if lockip<>"" then   
   Set rs = Conn.Execute( "Insert Into ip(name,ip,lock) Values('&nbsp;','"&lockip&"','1')")
	rs.close
end if

s=Hour(Time())
f=Minute(Time())


Const NumPerPage = 15  '设置你一页要显示多少记录        
 Dim CurPage            '取得当前所在页

    If Request.QueryString("CurPage") = "" then
        CurPage = 1 
    Else
        CurPage = Request.QueryString("CurPage")
    End If


    '设置游标属性
    conn.CursorLocation = adUseClient

    '设置缓存大小 = 每页需显示的记录数目
    conn.CacheSize = NumPerPage

    Dim strSQL
     strSQL = "select * from ip"
     set rs=conn.execute(strSQL)

    if not rs.eof then  
    rs.MoveFirst
    rs.PageSize = NumPerPage

    '计算最多有多少页
    Dim TotalPages,recdcount
    TotalPages = rs.PageCount
    rs.AbsolutePage = CurPage
    end if
    recdcount= rs.recordcount
%>

<div align="center">当前被封锁IP数为:<font color=red><%=recdcount%></font> 人 <a href="javascript:history.go(0)">刷新</a></div>
<hr noshade size="1" color=009900>
<div align=center> 
<font class=p10 color=#666666>请输入封锁的IP地址:</font><input maxLength="15" name="lockip" size="10" class="p9" tabIndex="1" style="width: 120; background-color: #FAFCEF; border: 1 solid #20663B">
<input type="submit" style="font-size:12px" value="永久封锁"></div>
<hr noshade size="1" color=009900>
<div align=center> 
<%
 Count = 1
    Do While Count <= TotalPages
        Response.Write("<a href=ipgl.asp?curpage=" &count& ">[" &count& "]</a> ")
        Count = Count + 1
    Loop
%>
</div>
<hr noshade size="1" color=009900>

<table border="1" cellspacing="0" bordercolorlight="#000000" bordercolordark="#FFFFFF" cellpadding="1" bgcolor="E0E0E0" align="center" width="98%">
<tr bgcolor="#3399FF"> 
    <td width='3%'><font color="#FFFFFF">序号</font></td>
    <td width='8%'><font color="#FFFFFF">用户名</font></td>
    <td width='10%'><font color="#FFFFFF">IP地址</font></td>
    <td width='10%'><font color="#FFFFFF">剩余解锁时间(M)</font></td>
    <td width='6%'><font color="#FFFFFF">立即解锁</font></td>
    <td width='6%'><font color="#FFFFFF">永久封锁</font></td>
  </tr>

<%Dim counton

counton = 0
Do while Not rs.EOF And counton < rs.PageSize
   s1=Hour(rs("time1"))
   f1=Minute(rs("time1"))
      if s<s1 then
       Count=30-(24+s1-s)*60+(f1-f)
       else 
       Count=30-(s1-s)*60+(f1-f)
      end if

IF count<1 and rs("lock")<>"1" then
  Set Connection = Server.CreateObject("ADODB.Connection")
  Connection.open "chat"
  Set rs1 = Connection.Execute( "delete from ip where ip='"&rs("ip")&"'")
  Connection.Close
else
%>
  <tr>
    <td><%=counton+1%></td>
    <td><%=rs("name")%></td>
    <td><%=rs("ip")%></td>
    <%IF rs("lock")="1" then%>
      <td>永久封锁</td>
    <td><a href="ipgl.asp?ip=<%=rs("ip")%>&lock=1">立即解锁</a></td>
    <td>&nbsp;</td>
    <%Else%>
    <td><%=Count%></td>
    <td><a href="ipgl.asp?ip=<%=rs("ip")%>&lock=1">立即解锁</a></td>
    <td><a href="ipgl.asp?ip=<%=rs("ip")%>&lock=2">永久封锁</a></td>
    <%End if%>

  </tr>
<% counton = counton + 1
end if
rs.MoveNext
Loop
rs.Close
End if%>
</table>
</form>
</body>
</html>

⌨️ 快捷键说明

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