<% username=trim(Request("name"))
items=split(application("people"),",")
'检查聊天室是否满员
If ubound(items)>10 then
   Response.Redirect "login.asp?msg=对不起，聊天室已经满员！"
End If 
'检查用户名是否重名
For i=0 to ubound(items) - 1
  If items(i) = username then
      Response.Redirect "login.asp?msg=对不起，用户名重名！"
  End If  
Next
'通过检查，进入聊天室   
Session("curruser")=username
Application.lock
Application("people")=application("people") & username &","
items=split(application("people"),",")
For i=0 to ubound(items) - 1
    str="(" & time & ")" & username & "说：大家好！<BR>"  
    Application(items(i))= str & Application(items(i))
Next
Application.unlock
Response.Redirect "main.asp"  %>
