To download the source code, please go to the original address: http://www.codeproject.com/Ajax/UChat.asp
This is a single chat room for multiple users. Basic chat functionality is possible, and some command lines such as/admin clear are used to purge chat records,/nick [Name] To change user nicknames, and so on. Program Description This program uses a Chatengine class to handle all the chat information and user information, the user information is stored in a Hashtable, and the chat information is stored in the StringCollection.
Declare an instance of a global chatengine in Global.asax.cs and share it for all users in Chat room:
public static UChat.ChatEngine.IChatEngine Engine = new UChat.ChatEngine.ChatEngine ();
timeID = window.setTimeout( "updateAll()", refreshRate );
Each user is uniquely identified by a username and a GUID.
public void AddUser(string id, string user)
//make sure user name does not exist already
if( !UserExists( user ) )
//add user to users list
users.Add( id, user );
//display a notification message to all users
joinedfmt, user ) ));
Program Run interface