📄 currentinfo.asp
字号:
<%@ LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>聊天成员</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<!--说明Web页的格式及编码方式。http-equiv="Content-Type"的实际取值由content的值确定。charset=gb2312表示字符集用简体中文。-->
<meta http-equiv="refresh" content="10;url=help.asp">
<!--实现每隔10秒刷新一次页面,然后转到help.asp页面,
这就是在main.asp页面聊天时time.asp,currentinfo.asp和help.asp为什么会交替显示的原因-->
<base target="rbottom">
<!--CSS样式表-->
<style type="text/css">
<!--
.style1 {
font-family: "华文行楷";
color: #6600FF;
}
.style2 {
font-family: "方正姚体";
color: #FF6633;
}
-->
</style>
</head>
<body>
<%
'创建数据库连接对象
set newconn=server.CreateObject ("ADODB.Connection")
dbpath=server.mappath("chatroom.mdb")
newconn.open "driver={Microsoft Access Driver (*.mdb)};dbq="&dbpath
'从房间信息表中查找并列出聊天室名称,话题,人数和聊天成员
newsql="select howmanyusers,Topic from RoomInfo where RoomName='" & session("myroom") & "'"
set newrecord0=newconn.Execute (newsql)
if not newrecord0.bof then
%>
<p><span class="style1"> <span class="style1">聊天室名称:<br>
</span> <span class="style2">
<% =session("myroom") %>
<br>
</span><span class="style1">话题:</span><br>
<span class="style2">
<% =newrecord0("topic") %>
<br>
</span><span class="style1">人数:</span> <span class="style2">
<% =newrecord0("howmanyusers") %>
<br>
</span> </span>
<p class="style1">聊天成员:</p>
<%
end if
'关闭记录集对象
newrecord0.close
set newrecord0=nothing
%>
<%
'列举出在该房间中的聊天成员
mysql="select OnLineUserID from UserOnLine where RoomName='" & session("myroom") & "'"
set newrecord=newconn.Execute (mysql)
do while not newrecord.eof
%>
<p class="style2">
<% =newrecord("OnLineUserID") %>
</p>
<%
newrecord.movenext
loop
'关闭记录集对象
newrecord.close
set newrecord=nothing
'关闭数据源连接对象
newconn.close
set newconn=nothing
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -