最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
asp+ajax做聊天室二
时间:2022-07-02 23:21:30 编辑:袖梨 来源:一聚教程网
下面的代码是post.asp文件代码.比较简单所以就不说明了.
%@Language="JavaScript" CodePage="936"%>
var Nothing;
Response.addHeader("Cache-Control","no-cahce");
if(!Session.Contents("Chat_User"))
{
Session.Contents("Chat_User") = "Guest";
Session.Contents("Chat_Time") = (new Date).getTime();
}
if(Application.Contents("Chat_Data") == Nothing)
{
Application.Lock();
Application.Contents("Chat_Data") = "f系统bredb您bblueb欢迎您来到聊天室。bblackb" + (3000 + (new Date).getTime());
Application.UnLock();
}
var PostChat = Request.QueryString.Item;
if(PostChat)
{
var Chat_Data = Application.Contents("Chat_Data").split("f");
if(Chat_Data.length > 30) Chat_Data.shift();
Chat_Data.push(Server.HtmlEncode(unescape(PostChat)) + "b" + (new Date).getTime());
Application.Lock();
Application.Contents("Chat_Data") = Chat_Data.join("f");
Application.UnLock();
}
var LastTime = Session.Contents("Chat_Time");
var MyData = new Array;
var AllData = Application.Contents("Chat_Data").split("f");
for(var C=AllData.length-1; C>=1; C--)
{
var Node = new Array;
var Item = AllData[C].split("b");
if(Item[6]
if(Item[6] > LastTime) LastTime = Item[6];
Node.push("" + Item[0] + "发送人>");
Node.push("" + Item[2] + "接收人>");
Node.push("" + Item[4] + "说话>");
Node = Node.join("ttrn");
Node = "t" + Node + "rnt聊天>";
MyData.push(Node);
}
Session.Contents("Chat_Time") = LastTime;
MyData.reverse();
%>
聊天室>
转载请注明出处()
相关文章
- 包子漫画免费阅读入口-包子漫画最新免费入口页面 12-20
- PBE手游卡在登录界面怎么办? 12-20
- 哔哩哔哩官网主入口-哔哩哔哩官方网站直达链接 12-20
- 微信文件传输助手网页版-官方入口与使用指南 12-20
- 妖精漫画纯净无广免费下拉式入口-妖精漫画免费登录下载入口今日开放 12-20
- 知到智慧树官网网址在哪 知到智慧树网页版快速登录入口 12-20