📄 admin.asp
字号:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>管理员</title>
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
<script language="vbscript" runat="server">
<!--
-->
</script>
</head>
<style type="text/css">
<!--
a:visited,a:link { text-decoration: none; color: #003399}
a:hover { text-decoration: none; color: #3333FF}
a.linkwhite:link,a.linkwhite:visited { text-decoration:none; color:white}
a.linkwhite:hover { text-decoration: underline; color:white}
a.linkblack:link,a.linkblack:visited { text-decoration:none; color:black}
a.linkblack:hover { text-decoration: underline; color:black}
input { font-family: "宋体"; font-size: 9pt}
td { font-family: "宋体"; font-size: 9pt; color: #000000}
.en { font-family:"Verdana", "Arial"; font-size: 9pt}
.white { color: #FFFFFF}
.line { line-height: 20px}
.title { font-size: 14px }
-->
</style>
<body bgcolor="#9999FF">
<%
if Request.ServerVariables ("REQUEST_METHOD")="POST" then
set newconn=server.CreateObject ("ADODB.Connection")
newconn.ConnectionString ="DSN=ChatRoom"
newconn.Open
newsql="select Right from EverUser where UserID='" & Request.Form ("Admin_UID") & "' and PWD='" & Request.Form ("Admin_PWD") & "'"
set newrecord=newconn.Execute (newsql)
if newrecord.bof then
Response.Write ("密码和帐号输入错误!<br>")
else
if newrecord(0)=9 then
for each item in Request.Form ("IpAdd")
if item <>"" then
hisip=item
newsql="select IpAdd from FaultIpAdd where IpAdd='" & hisip & "'"
set newrecord4=newconn.Execute (newsql)
if not newrecord4.bof then
newsql="update FaultIpAdd set FaultTimes=FaultTimes+1,IfClosed=true,TimeClose='" & date() & "',TimeOpen='" & dateadd("d",2,date()) & "' where IpAdd='" & hisip & "'"
newconn.Execute (newsql)
else
newsql="insert into FaultIpAdd (IpAdd,TimeClose,TimeOpen,IfClosed,FaultTimes) values ('" & hisip & "','" & date() & "','" & dateadd("d",2,date()) & "',1,1)"
Response.Write newsql
newconn.Execute (newsql)
end if
newsql="select UserID from UserOnLine"
set newrecord5=newconn.Execute (newsql)
if not newrecord5.bof then
do while not newrecord5.eof
application(newrecord5(0))="<br>IP--<font color=vbred>" & hisip & "</font>--已经被封!<br><br>" & application(newrecord5(0))
newrecord5.movenext
loop
end if
Response.Write "<br>IP地址--<font color=vbred>" & hisip & "</font>--已经被封!<br>"
end if
next
for each item in Request.Form ("cUserID")
if item <>"" then
newsql="update EverUser set FaultCount=FaultCount+1,IfClosed=true,CloseTime='" & date() & "',OpenTime='" & dateadd("d",5,date()) & "' where UserID='" & item & "'"
newconn.Execute (newsql)
newsql="select UserID from UserOnLine"
set newrecord6=newconn.Execute (newsql)
if not newrecord6.bof then
do while not newrecord6.eof
application(newrecord6(0))="<br>用户<font color=vbred>" & item & "</font>已经被封!<br><br>" & application(newrecord6(0))
newrecord6.movenext
loop
end if
Response.Write "<br>用户<font color=vbred>" & item & "</font>已经被封!<br>"
end if
next
for each item in Request.Form("kUserID")
if item<>"" then
newsql="select RoomName,IpAdd from UserOnLine where UserID='" & item & "'"
set newrecord0=newconn.Execute (newsql)
hisroom=newrecord0(0)
newsql="delete from UserOnLine where UserID='" & item & "'"
newconn.Execute (newsql)
newsql="update EverUser set FaultCount=FaultCount+1 where UserID='" & item & "'"
newconn.Execute (newsql)
newsql="update RoomInfo set HowManyUsers=HowManyUsers-1 where RoomName='" & hisroom & "'"
newconn.Execute (newsql)
newsql="select UserID from UserOnLine"
set newrecord7=newconn.Execute (newsql)
if not newrecord7.bof then
do while not newrecord7.eof
application(newrecord7(0))="<br>用户--<font color=vbred>" & item & "</font>--已经被踢出!<br><br>" & application(newrecord7(0))
newrecord7.movenext
loop
end if
application(item)="***kickout***"
Response.Write "用户<font color=vbred>" & item & "</font>已经被踢出聊天室!<br>"
end if
next
newsql="select * from UserOnLine"
set newrecord1=newconn.Execute (newsql)
if newrecord1.bof then
Response.Write ("目前没有线上用户!<br>")
%>
<p align="center"><font color="#FF8000"><strong><big><big><big>在线用户信息信息</big></big></big></strong></font></p>
<center>
<table border="1"
style="text-align: center; color: rgb(0,0,255)">
<tr>
<td>是否Kick</td>
<td>封ID</td>
<td>封IP</td>
<td>用户名</td>
<td>呢称</td>
<td>Ip地址</td>
<td>房间号</td>
</tr>
</table>
</center>
<%
else
%>
<p align="center"><font color="#FF8000"><strong><big><big><big>在线用户信息信息</big></big></big></strong></font></p>
<form name="admin" method="POST" action="admin.asp" align="center">
<center>
<table border="1"
style="text-align: center; color: rgb(0,0,255)">
<tr>
<td>是否Kick</td>
<td>封ID</td>
<td>封IP</td>
<td>用户名</td>
<td>呢称</td>
<td>Ip地址</td>
<td>房间号</td>
</tr>
<%
do while not newrecord1.eof
%>
<tr>
<td><input name="kUserID" type="checkbox" value="<% =newrecord1("UserID") %>"></td>
<td><input name="cUserID" type="checkbox" value="<% =newrecord1("UserID") %>"></td>
<td><input name="IpAdd" type="checkbox" value="<% =newrecord1("IpAdd") %>"></td>
<td><a href="singleuser.asp?userid=<% =newrecord1("UserID") %>"><% =newrecord1("UserID") %></a></td>
<td><% =newrecord1("NickName") %></td>
<td><% =newrecord1("IpAdd") %></td>
<td><% =newrecord1("RoomName") %></td>
</tr>
<%
newrecord1.movenext
loop
end if
%>
</table>
</center>
<font color="#FF0000"><div align="center"><center><p>请输入帐号:</font>
<input type="text" name="Admin_UID" size="21"
style="color: rgb(255,0,0); background-color: rgb(0,255,255)"></p>
</center></div>
<div align="center"><center><p><font color="#FF0000"> 请输入密码:</font>
<input type="password" name="Admin_PWD" size="21" style="background-color: rgb(0,255,255); color: rgb(255,0,0)"></p>
</center></div>
<div align="center"><center><p><input type="submit" value="提交" name="B1">
<input type="reset" value="重写" name="B2"></p>
</center></div>
</form>
<center><a href="foreveruser.asp">永久用户管理</a></center>
<center><a href="singleuser.asp">发送信息</a></center>
<%
else
Response.Write ("你没有权限进入!<br>")
end if
end if
else
%>
<form method="POST" action="admin.asp" name="check">
<font color="#FF0000"><div align="center"><center><p>请输入帐号:</font>
<input type="text" name="Admin_UID" size="21"
style="color: rgb(255,0,0); background-color: rgb(0,255,255)"></p>
</center></div>
<div align="center"><center><p><font color="#FF0000"> 请输入密码:</font>
<input type="password" name="Admin_PWD" size="21" style="background-color: rgb(0,255,255); color: rgb(255,0,0)"></p>
</center></div>
<div align="center"><center><p><input type="submit" value="Submit" name="B1">
<input type="reset" value="Reset" name="B2"></p>
</center></div>
</form>
<%
end if
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -