Implement room functions and user display in asp chat rooms

Source: Internet
Author: User
Implement room functions and user display in asp chat rooms
After I wrote the article "implementing the whispering function in asp chat rooms", many of my friends sent me a letter asking me
About other advanced functions. Indeed, advanced functions such as room and user management are perfect
Functions necessary for chatting rooms. It is difficult to implement the room function. So I want to talk to you.
This problem.
I still prefer to use arrays to solve these two problems. This does not mean that the database cannot be used to solve them, but we
Consider performance issues. In addition, array has several advantages, which facilitates sorting and controls the total length. On the server
Long memory resident (conducive to performance improvement ). Let me talk about the room first. Here we will show you the room in two systems.
The switch method in the room. As for the method of self-built houses, we hope everyone can bypass the class. For more information about online user display
The problem is that we need to display the users and total users in each room, so there will be some interaction with the room.
Please note. For your convenience, I try to write these functions as subprograms or subfunctions. You can
Direct application.
Let's first look at the definition in gloable. asa, which is very important.
<Script language = "VBScript" RUNAT = "Server">
Sub Application_OnStart ()
Application ("gRoom_Name") = "Xiaoyaoyou" 'saves the name of the main chat room, which is first served by all users.
Dim pChat_Value (50)
Application ("gRoom_Name") & "_ Value") = pChat_Value 'p stands for private g stands for globle to save the content of the chat room
Application ("gRoom_Name") & "_ Number") = 0' is used to save the Number of conversations in the chat room.
Application ("Health care master" & "_ Value") = pChat_Value
Application ("Health care master" & "_ Number") = 0
Dim pChater_Value (150)
Application ("gRoom_Name") & "er_Value") = pChater_Value 'is used to save the name of the chatbot in the chat room.
Application ("gRoom_Name") & "er_Number") = 0 'is used to indicate the number of people who are online in the chat room
Application ("Health care master" & "er_Value") = pChater_Value
Application ("Health care master" & "er_Number") = 0
Dim pRoom_Value (50)
PRoom_Value (0) = "Xiaoyao game" & "(" & "system" & ")" & "[" & application ("gRoom_Name") & "er_Number ") & "]" & "persons"
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.