Implement the whisper function using ASP

Source: Internet
Author: User
I once worked on a complex chat room, and almost had all the functions of the BBS chat room, but it was a waste of resources because it was made using applications. I think it is more reliable and easier to use databases.
You can set a database chat with the following structure:
    
Field Name Type length remarks
1. object char 10 operation OBJECT, ALL or someone
2. msg char 250 message content
3. time datetime sending TIME
4. sender char 10 SENDER
5. room char 10 ROOM name, Sender's ROOM
    
In general, the OBJECT is ALL. You can specify someone when you need to whisper.
When the content is displayed, you only need to say "Select * from chat where object = 'all' or object = '" & session ("userid. Session ("user id") is the identity authentication of the current USER.
In this way, the chat content that each user sees is "expected. If you use other data tables, such as ROOM and USER, you can also perform functions such as stealth, kicking, opening, closing, and hiding a ROOM. If you add an EMOTE. TXT can be used for emoticons. Of course, to do this, you need to have an interpreter in sending information to determine the command you entered and modify the data table accordingly.
Roking: roking@21cn.com
    
First, let's talk about the overall idea: use the application object to save all public chat information, such as the visitor ID, room status, and public chat information. At the same time, use the Senssion object to save personal information for everyone, such as emoticon, color, and conversation target ID.
The user's display area retrieves public chat information from the application object and adds private chat information for the user ....
    
    
Nikl: nikl@163.net
    
You only need to use the Application and Session built-in objects to easily implement the following!
    
An independent Application and Session object is created for the user during login. For example, three users, nikl hero viki, used ASP requests to obtain three user names and saved them to a variable (such as name) for Session and Application initialization:

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.