当前位置: 首页 > 图文教程 > 网络编程 > ASP > 聊天室实现私聊(三)

ASP
看人家用使用InstallShield制作ASP安装程序(5)
看人家用使用InstallShield制作ASP安装程序(4)
看人家用使用InstallShield制作ASP安装程序(3)
看人家用使用InstallShield制作ASP安装程序(2)
看人家用使用InstallShield制作ASP安装程序(1)
取得浏览者的离开时间
base64编码、解码函数
动态显示图片的函数(显示广告条)
发送带附件的HTML格式邮件例程可以带附件
一种在父窗口中得知window.open()出的子窗口关闭事件的方法
一个老个写的无组件上传
避免asp的SQL的执行效率低
树型结构在ASP中的简单解决
无需数据库循环的无级分类代码
检查字符串strSource是否为big或big5码
有关重复记录的删除(SQL SERVER)
WINDOWS2000服务器账号登陆身份验证
使用VC++6.0制作ASP服务器控件简介
利用sql的存储过程实现dos命令的asp程序
WSH 直接将查询数据结果生成 EXCEL 表

ASP 中的 聊天室实现私聊(三)


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 178 ::
收藏到网摘: n/a

 


作者:网络之门

  上两节介绍了如何处理聊天室内的谈话内容以及悄悄话的特殊处理,至此。我们去看看谈话内容是如何在客户端显示出来的。请先看看我们的显示对话文件(top.asp)

*top.asp

 

<% @language="vbscript" %>
<%
Response.Expires=0
'response.buffer=true
%>
<meta http-equiv="refresh" content="2.5">
<body bgcolor="<%=application("zj_1color")%>" topmargin="0" leftmargin="0">
<I><center><font color="#FFFF00" size=4><%=application("zj_1title")%></font></center></I>
<%
if session("userzj_1")="" then
session("userzj_1")=""
session("zj_1level")=""
session("zj_1start")=""
session("zj_1total")=0
session("zj_1boot")=""
session("zj_1counter")=0
session("zj_1open")=""
'session.abandon
%>
<script LANGUAGE="JavaScript">
parent.location="timeout.htm"
</script>
<%
response.end
end if

'是否在捣乱?
for n=1 to 40
if session("userzj_1")=application("peoplezj_1"&n) then
exit for
end if

if n=40 then
session("zj_1boot")="true"
%>
<script LANGUAGE="JavaScript">
parent.location="boot.htm"
</script>
<%
end if

next
%>
<script LANGUAGE="JavaScript">
<%

if session("zj_1counter")<>application("zj_1counter") then
if session("zj_1counter")<application("zj_1counter") then
for I=session("zj_1counter")+1 to application("zj_1counter")
%>
parent.middle.document.writeln("<%=application("zj_1chats")(I)%>")
<%

next   

else
for I=session("zj_1counter") to 20
if application("zj_1counter")<>1 then
%>
parent.middle.document.writeln("<%=application("zj_1chats")(I)%>")
<%
end if
next

for I=1 to application("zj_1counter")

%>
parent.middle.document.writeln("<%=application("zj_1chats")(I)%>")
<%
next
end if

if session("zj_1open")="true" then

session("zj_1counter")=application("zj_1counter")
end if
end if

'公告

if session("zj_1public")<>application("zj_1public") then
%>
parent.middle.document.writeln("<%=application("zj_1public")%>")

<%
session("zj_1public")=application("zj_1public")
end if

'有耳语吗?
if session("zj_1chat")<>application("zj_1chat") then
if application("zj_1owner")=session("userzj_1") or application("zj_1chatto")=session("userzj_1") or application("zj_1chatto")="ALL" then

%>
parent.middle.document.writeln("<%=application("zj_1chat")%>")
<%
end if
session("zj_1chat")=application("zj_1chat")
end if

application("peoplezj_1_appear"&n)

count=0
for n=1 to 40
if applic