Jump to content
Xtreme .Net Talk

Roxbury

Members
  • Posts

    3
  • Joined

  • Last visited

Roxbury's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. I'm using the Client/Server example from 101 vb samples 2003 and I'm wondering how would I be able to have the users send messages to eachother individually? Currently you only talk in a public chat, however, for them to talk to individual people I think I need to connect to their ip, however, the server side doesn't seem to put the clients ip in the hashtable it creates. Can anyone please tell me how to go about recording the clients ip in the hashtable? The following is my server side code for it to listen for connections and put them into the hashtable, hopefully that helps. Private clients As New Hashtable Private listener As TcpListener Private listenerThread As Threading.Thread Private Sub DoListen() Try listener = New TcpListener(System.Net.IPAddress.Any, PORT_NUM) listener.Start() Do Dim client As New UserConnection(listener.AcceptTcpClient) AddHandler client.LineReceived, AddressOf OnLineReceived UpdateStatus("New connection found: waiting for log-in") Loop Until False Catch End Try End Sub Private Sub ConnectUser(ByVal userName As String, ByVal sender As UserConnection) sender.Name = userName UpdateStatus(userName & " has joined the chat.") clients.Add(userName, sender) ListUsers(sender) SendToClients("CHAT|" & sender.Name & " has joined the chat.", sender) End Sub
  2. Thanks, it worked.
  3. If the user that is put into the listview is Roxbury or Roxbury22 then I need the text to be red, however, it is remaining the default white...Can anyone help me here? ListView1.Items.Clear() Dim I As Integer For I = 1 To users.Length - 1 ListView1.Items.Add(users(I)) If ListView1.Items(I).Text = "Roxbury" Or "Roxbury22" Then ListView1.Items(I).ForeColor = Color.Red End If Next
×
×
  • Create New...