繁体中文
设为首页
加入收藏
当前位置:ASP技术首页 >> 安全加密 >> XMLHTTP+Javascript+Asp写得聊天室,无刷新实现(四)

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

2006-05-15 08:00:00  作者:  来源:互联网  浏览次数:0  文字大小:【】【】【
简介:   ########say.asp############## 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 (newLidu_Lid) and ((c_i...

   ########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=""&trim(F)&""&trim(T)&""&E&""&trim(sC)&""&trim(cL)&""&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 '""&trim(F)&""&trim(T)&""&E&""&trim(sC)&""&trim(cL)&""&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 ""

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

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

end if

next

Response.Write ""

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%>

责任编辑:admin
相关文章