head
title登记进入聊天室/title
script language=vbscript
function ao()
li.name.value=Trim(li.name.value)
if li.name.value= then li.name.value=匿名来客
li.submit
end function
function ch(whichobj)
whichobj.checked=true
end function
/script
/head
body background=backchat.jpg bgcolor=#FFFFFF
table height=100%
tr
td valign=center
center
font color=#FF0000 size=5 face=隶书聊 天 室/font
’Connections
set con=createobject(adodb.connection)
con.open wwwchat.dbf
set application(wwwchat)=con
set con=nothing
’For actions
dim action(1,200),actionsize,actioncount,actionselect
actionselect=
actionsize=200
actioncount=0
con=application(wwwchat)
set rec=createobject(ADODB.recordset)
rec.open select * from application(filepath)chataction.dbf,co
n
do until rec.EOF
if actioncount=actionsize then
exit do
end if
actionname=trim(rec(action))
actionmeaning=trim(rec(meaning))
actionselect=actionselectoption value=chr(34)actionnamechr(3
4)replace(actionmeaning,#,(对象))/option
actioncount=actioncount+1
action(0,actioncount)=actionname
action(1,actioncount)=actionmeaning
rec.MoveNext
loop
rec.close
set rec=nothing
set con=nothing
application(action)=action
application(actioncount)=actioncount
application(actionselect)=actionselect
Application.unlock
END SUB
SUB Application_OnEnd
Application.lock
set application(alinks)=nothing
set application(linktoaa)=nothing
Application.unlock
END SUB
/script
----------------
chat.asp
% @ language=vbscript %
html
head
title聊天室/title
script language=javascript
function kp() {
if (event.keyCode==13) e(0);
}
function ref() {
if (event.shiftKey==1 event.ctrlKey==1 event.altKey==1) {
see.location=http://118.118.118.45/vclass/seeinfo.asp?lastcount=0
ip=1;}
else {
see.location=http://118.118.118.45/vclass/seeinfo.asp?lastcount=0
;
}
}
/script
script language=vbscript
function e(way)
if way=3 then
talk.document.location=about:blank
talk.document.location=about:blank
call ref
exit function
end if
if way=1 then
cc.obj.value=
cc.words.value=我走了......
end if
cc.words.value=
a=http://118.118.118.45/vclass/send.asp?obj=n1words=n2name=
replace(replace(replace(replace(cc.name.value,%,%25),#,%23),
,%26),?,%3F)
parent.sendwords.location=a
end function
/script
/head
%@language=vbscript%
%
if request.querystring(pw)=g11chat then
if request.querystring(action)=clear then
application.lock
application(userlist)=
application(userhtml)=
application(usercount)=0
application.unlock
response.write OK!
end if
end if
%
-------------
seeinfo.asp
% @ language=vbscript %
% Response.Expires=0 %
html
head
script language=javascript
function mclick(st) {
if (event.altKey==1
parent.uif.document.cc.obj.value!=) {
parent.uif.document.cc.obj.value=st+、+parent.uif.document.cc.
obj.value;
return 0;
}
parent.uif.document.cc.obj.value=st;
}
function c(ct) {
location=seeinfo.asp?lastcount=+ct;
}
/script
script language=vbscript
function mover(ob)
ob.style.background=blue
ob.style.color=red
end function
function mout(ob)
ob.style.background=
ob.style.color=
end function
function mclic1k(st)
parent.uif.document.cc.obj.value=st
end function
/script
/head
body bgcolor=#ffffff onError=
%
’Get paraments
dim lastcount,ipable
lastcount=request.querystring(lastcount)+0
ipable=request.querystring(ip)+0
response.write !--lastcount--
’Creat connection
set con=application(wwwchat)
set rec=createobject(adodb.recordset)
if lastcount=0 then
if ipable1 then
rec.open select * from application(filepath)wwwchat where va
l(id)recc()-10,con
else
rec.open select * from application(filepath)wwwchat where va
l(id)recc()-200,con
end if
else
rec.open select * from application(filepath)wwwchat where va
l(id)lastcount,con
end if
’Seek records
dim j,lastid,thisid
j=
response.write script language=vbscript
%
parent.uif.talk.document.write font face=宋体
%
do until rec.EOF
if j then %
script language=javascript
parent.uif.talk.scroll(0,65000);
parent.uif.talk.scroll(0,65000);
parent.uif.talk.document.write(/font);
/script
%
else
j=lastcount
end if
%
% @ language=vbscript%
%response.expires=0%
%
function relist
dim nl,nlen,startp,c,nh
response.write inlist:application(userlist)
nl=application(userlist)
nlen=len(nl)
startp=1
c=0
nh=
do while startpnlen
le=instr(startp,nl,)
ri=instr(startp,nl,)
if le0 and lenlen and rile and ri=nlen then
ss=replace(mid(nl,le+1,ri-le-1),chr(34),)
nh=nhtrtd onMouseover=’mover(this)’ onMouseOut=’mout(this)’
onClick=’mclick(chr(34) replace(ss,chr(34),(引号)) chr(34))
’
nh=nhss/td/trchr(13)chr(10)
’response.write one!nh
chr(34)chr(34)chr(34)
c=c+1
else
exit do
end if
startp=ri+1
loop
application.lock
application(userhtml)=nh
application(usercount)=c
’response.write nhaa
end function
%
html
%
’Send message
dim obj,name,words,iname
obj=trim(request.querystring(obj))
if obj= then obj=所有人
name=replace(replace(replace(trim(request.querystring(name)),;,;
),[,[),],])
words=replace(replace(replace(trim(request.querystring(words)),;,
;),[,[),],])
byebye=trim(request.querystring(go))
joinin=trim(request.querystring(joinin))
iname=replace(replace(name,,),,)
if joinin=1 and instr(application(userlist),iname)0 then
response.end
end if
if byebye=1 then
application.lock
application(userlist)=replace(application(userlist),iname
,)
application.unlock
call relist
else
if instr(application(userlist),iname)=0 then
application.lock
application(userlist)=application(userlist)iname
application.unlock
call relist
end if
end if
set con=application(wwwchat)
set com=createobject(adodb.command)
com.activeconnection=con
response.write send this time
dim n1,n2,sd,ad
n1=name
n2=obj
n2=对font color=bluen2/font说:words
action=application(action)
actioncount=application(actioncount)
for ai=1 to actioncount
if action(0,ai)=words then
words=font color=redaction(1,ai)/font
for i=1 to len(words)
c=right(left(words,i),1)
if c=# then
words=left(words,i-1)font color=blueobj/fontrigh
t(words,len(words)-i)
exit for
end if
next
n2=:words
end if
next
script language=javascript
function kp() {
if (event.keyCode==13) e(0);
}
function ref() {
if (event.shiftKey==1 event.ctrlKey==1 event.altKey==1) {
parent.refresh.location=seeinfo.asp?lastcount=0&ip=1;}
else {
parent.refresh.location=seeinfo.asp?lastcount=0;
}
}
/script
script language=vbscript
function aclick
cc.words.value=cc.action(cc.action.selectedindex).value
end function
function bye()
parent.refresh.location=about:blank
parent.sendwords.location=send.asp?go=1obj=所有人words=我走了......
name=replace(replace(replace(replace(cc.name.value,%,%25),#,
%23),,%26),?,%3F)
alert 欢迎希望您下次再来!
end function
function e(way)
if way=3 then
talk.document.location=about:blank
talk.document.location=about:blank
call ref
exit function
end if
if way=1 then
parent.location=http://118.118.118.45/chat
exit function
end if
cc.words.value=
a=send.asp?obj=n1words=n2name=replace(replace(replace(rep
lace(cc.name.value,%,%25),#,%23),,%26),?,%3F)
parent.sendwords.location=a
end function
/script
/head
body background=backchat.jpg leftmargin=0 topmargin=0 rightmargin=0
bottommargin=0 onUnload=bye()
script language=vbscript
call first
function first
parent.sendwords.location=send.asp?joinin=1obj=所有人words=我来了..
....name=replace(replace(replace(replace(cc.name.value,%,%25),
#,%23),,%26),?,%3F)
b=seeinfo.asp?lastcount=0
parent.refresh.location=b
cc.words.focus
end function
/script
/body
/html
-------------
userlist.asp
% @ language=vbscript %
% Response.Expires=0 %
html
head
script language=vbscript
function mover(ob)
end function
function mout(ob)
end function
function mclick(st)
alert 只有在加入聊天时,才能进行用户选择!
end function
/script
/head
body bgcolor=#ffffff onError=
script language=javascript
setTimeout(location.reload(),3000);
/script
%
if application(usercount)0 then
%
center用户列表/center
hr
table width=100% align=center style=cursor:hand
%
=application(userhtml)
%
/table
hr
center共font color=red%=application(usercount)%/font人/cent
er
%
else
%
table width=100% height=100%
trtd align=center valign=center
font size=4 face=隶书 color=bluecenter我们等待着您的光临/center
/font
/td/tr
/table
%
end if
%