ASP realizes the OICQ-type information transceiver function

Source: Internet
Author: User
Tags array empty time interval unique id
Should be the majority of friends of the proposal, the site will often introduce the program design ideas of the article.

In the ASP implementation of the OICQ-style messaging function, there are many ways to implement this function, here I mainly introduce the way to access information by array.

Define an array variable in asp: Application (Id,ix) (Example: Application (100,30)), ID for the user number, can be 100, is to allow 100 users to use online information to send, a user has a unique ID ; The following IX is the number of information bars for a user! A value of 30 o'clock is a user can put up to 30 messages at the same time.

When a user login to the user to assign a user is not occupied by the ID number (for example, the user ID is 3), when someone sends a message to him, as long as the message sent to application (3,ix), before depositing to determine whether this application (3,ix) is empty, Keep the information in when it is empty. If not empty, put the ix+1, if Application (3,ix+1) or not empty, put ix+2 ... to 30, the return of information is full, call this user a moment later. (can be used for ...). The next statement implements the ix+ features above. IX from 1 to 30,0 there are other uses.

How do users receive information from other users? In the
Also important is how to know whether an ID has been used, as the user occupies an ID, the application (id,0) value is the user name, so that application (id,0) has a value, which means that the ID has been occupied, other new landing users using the ID, The statement is used to determine whether the value of application (id,0) is null, and if it is null, this ID is not occupied. If a user closes the browser, you must clear the value of this ID's application (id,0), otherwise this ID will always be occupied, and other users will not be able to use this ID.

About the implementation of OICQ in ASP has been basically completed, if you want to do better, for example, use the user name instead of the user ID, because how to say the name than the number of the ID is good to remember, then you have to do a good job, because the fine road above has achieved this function.


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.