·您的位置: 首页 » 资源教程 » 编程开发 » ASP » XMLHTTP+JAVASCRIPT+ASP写得聊天室,无刷新实现(四)

XMLHTTP+JAVASCRIPT+ASP写得聊天室,无刷新实现(四)

类别: ASP教程  评论数:0 总得分:0
########say.asp##############

<% Option Explicit
dim F,T,sC,cL,E,W,sJ
Response.ContentType="text/xml"
F=Request.Form ("F")
T=Request.Form ("T")
sC=Request.Form ("sC")
cL=Request.Form ("cL")
E=Request.Form("E")
\'W=Request.Form("W")
W="0"
\'发言时间
sJ=getTime()
if Request.ServerVariables("REQUEST_METHOD")="POST" then
sC="<F>"&trim(F)&"</F><T>"&trim(T)&"</T><E>"&E&"</E><sC>"&trim(sC)&"</sC><cL>"&trim(cL)&"</cL><sJ>"&sJ&"</sJ>"
else
Response.End
end if
dim c_info,c_Lid,c_Ip,u_Lid,NewLid,u_name,i
Application.Lock
c_info=Application("c_info")
c_Lid=Application("c_Lid")+1
Application("c_Lid")=c_Lid
c_Ip=(c_info(0)+6) mod 240
c_info(0)=c_Ip
c_info(c_Ip)=c_Lid
c_info(c_Ip+1)=F
c_info(c_Ip+2)=T
c_info(c_Ip+3)=W
c_info(c_Ip+4)=""
c_info(c_Ip+5)=sC \'"<F>"&trim(F)&"</F><T>"&trim(T)&"</T><E>"&E&"</E><sC>"&trim(sC)&"</sC><cL>"&trim(cL)&"</cL><sJ>"&sJ&"</sJ>"
Application("c_info")=c_info
Application.UnLock
u_Lid=session("u_Lid")
newLid=u_Lid
u_name=session("u_name")
\'&Application("c_Lid")&"%"&c_info(0)

Response.Write "<?xml version=""1.0""?><Msg>"
for i=c_info(0)+6 to 240 step 6
if (c_info(i)>u_Lid) and ((c_info(i+1)=u_name) or (c_info(i+2)=u_name) or (c_info(i+2)="大家") or (c_info(i+3)="0")) then
Response.Write c_info(i+5)
if (newLid<c_info(i)) then newLid=c_info(i)
end if
next
for i=1 to c_info(0) step 6
if (c_info(i)>u_Lid) and ((c_info(i+1)=u_name) or (c_info(i+2)=u_name) or (c_info(i+2)="大家") or (c_info(i+3)="0")) then
Response.Write c_info(i+5)
if (newLid<c_info(i)) then newLid=c_info(i)
end if
next

Response.Write "</Msg>"
session("u_Lid")=newLid

function getTime()
dim y,m,d,h,n,s
y=Year(date())
m=Month(date())
d=Day(date())
h=Hour(time())
n=Minute(time())
s=Second(time()) \'当为是一位的 时候在前面加0
if len(m)=1 then m="0" & m
if len(d)=1 then d="0" & d
if len(h)=1 then h="0" & h
if len(n)=1 then n="0" & n
if len(s)=1 then s="0" & s
getTime=y&"/"&m&"/"&d &" " & h&":"& n&":"&s
end function%>
-= 资 源 教 程 =-
文 章 搜 索
关键词:
类型:
范围:
纯粹空间 softpure.com
Copyright © 2006-2008 暖阳制作 版权所有
QQ: 15242663 (拒绝闲聊)  Email: faisun@sina.com
 纯粹空间 - 韩国酷站|酷站欣赏|教程大全|资源下载|免费博客|美女壁纸|设计素材|技术论坛   Valid XHTML 1.0 Transitional
百度搜索 谷歌搜索 Alexa搜索 | 粤ICP备19116064号-1