Question Chat Clients Connected

hawk

Member
Joined
Sep 6, 2008
Messages
8
Programming Experience
Beginner
Hello Folks,

I'm using VB2008 Express

using the code available to download here

Home-brew Your Own Instant Messenger App with Visual Studio .NET

1) Is it possible to set the client script to show whos online/connected?

2) Is the key the
VB.NET:
Public Shared AllClients As New HashTable

3) How can this data be recovered?

thanks for any help and advice.

regards

Hawk
 
1. yes
2. the AllClients shared HashTable contains the clients by ip string key.
3. discovered you mean? (or perhaps you lost it? :)) iterate the Keys of the AllClients
VB.NET:
For Each key As String In ChatClient.AllClients.Keys
or iterate the clients (in which case you may want to expose for example the nick as a readonly property)
VB.NET:
For Each client As ChatClient In ChatClient.AllClients.Values
You may want to use a Dictionary(Of String, ChatClient) instead of the HashTable, which is a Dictionary(Of Object, Object).
 
Back
Top