<SCRIPT LANGUAGE="VBScript" RUNAT="Server">
SUB Application_OnStart
dim maChats(15) 定义一个具有15个元素的数据.
Application("gaChats")=maChats 存储谈话的内容.
Application("giCounter")=0 存储已有的谈话数目.
END SUB
</SCRIPT>
<p align="center"><font size=5>一个简单的聊天室</font></p>
<br>
<%
处理输入
if Request.ServerVariables("Request_Method")="POST" then
标明讲话者
if len(Request("txtWho"))>0 then
Session("ssWho")=Request("txtWho")
end if
封锁Application对象
Application.Lock
创建本地引用指针
mlCounter=Application("giCounter")
maChats=Application("gaChats")
如果写入的行数超过10,则重新开始记数.
if mlCoundter>9 then
mlCoundter=0
end if
增加用户的输入,计数器加1
maChat(mlChounter)=Session("ssWho")&":"&Request("txtCents")
mlCounter=mlCounter+1
把局部变量设置为在应用范围内有效.
Applicati "giCounter")=mlCounter
Application("gaChats")=maChat
消除Application对象的封锁
Application.Unlock
end if
%>
<%
写入TextArea
if Application("giCounter")=0 then
lstemp=Application("gaChats")(0)
else
for x=0 to Application("giCounter")-1
lstemp=lstemp&"<br>"Application("gaChats")(x)
next
end if
Response.white lstemp
%>
<hr>
<form method="POST" action="aspchat.asp" name="frmAsp"> <div align="center"><center><p>发言:<input type="text" name="txtCents" size="34"></p> </center></div><div align="center"><center><p>对象:<input type="submit" value="送出" name="B1"></p> </center></div> </form>
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有