Chat room key technology - user disconnection processing
Author: Yang Guo heroes Transfers: www.ChinaAsp.com in compiling chat rooms, user disconnection process is a matter of sting, especially put on the website for free, if blindly rely global.asa, when triggered session_onend, Application_ONEND is an uncertain number. When designing, reasonable arrangements will bring unexpected benefits. So what is the easiest way to handle the user's disconnection? The author has been experimenting, with the following methods: chat room with n Application ("User" to save the username, use Application ("Timebegin" to save each user's login time, while logging in Save the login time ("Timerbegin"), and set the refresh time in the speech area for n seconds, each time you refresh the time update of the session ("timebegin"), and judge Timer - Application ("User" & session (userid)) Whether> n seconds, if it is that the user does not automatically refresh, that is, it means that it has been disconnected, it can be set to a null value, and then the user has exited it. . Some code: total = Application ("allpeople") 'chat total number Aryhuman = split (Total, ";") for i = lbound (aryhuman) to Ubound (Aryhuman) - 1 IF Application ("User" = " Online "Then IF INT (Timer) - Int (Application (" TimeBegin ")> 120 Then Application (" User "=" "Temp = Aryhuman (i) AryName = Split (TEMP,", ") HREFNAME = aryname (0) for j = lbound (aryhuman) to Ubound (Aryhuman) - 1 if Application ("User" = "Online" Then Application ("Content" = " [Announcement] "& hrefname &" font> "&" "&" disconnection ... "&" font> "&" < "& Time () &"> font>
"& Application (" Content "& J) end if next end if endiff