Hi all!
I was build networkchat in vb6 but now I wonna make new version in vb 2008 and I have problem with userlist.
When I run once chat it work fine but when someone else connect he can't see all userlist he see only his name not all userlist

sorry for bad english

can you halp me please



Code of Server: Code:
  1. Function DataParsing(ByRef strData As String, ByRef Index As Short) As Object
  2.         On Error Resume Next
  3.        
  4.         Dim Command_Renamed, Info As String
  5.         Dim i As Short
  6.        
  7.         Command_Renamed = VB.Left(strData, InStr(strData, " ") - 1)
  8.         Info = VB.Right(strData, Len(strData) - InStr(strData, " "))
  9.        
  10.         Dim User, UserText As String
  11.         Dim UserE As Boolean
  12.         Select Case Command_Renamed
  13.            
  14.             Case "Message"
  15.                
  16.                 For i = 1 To wskServer().UBound
  17.                     Call wskServer(i).SendData("Message " & Info)
  18.                     System.Windows.Forms.Application.DoEvents()
  19.                 Next i
  20.  
  21.             Case "Join"
  22.                 If CheckUsername(Info) = True Then
  23.                     Call wskServer(Index).SendData("ErrUsername " & Info)
  24.                     System.Windows.Forms.Application.DoEvents()
  25.                     Return ""
  26.  
  27.                     Exit Function
  28.                 End If
  29.                
  30.                 Num = Num + 1
  31.                 lblCount.Text = CStr(Num)
  32.                
  33.                 Call lstUsers.Items.Add(Info)
  34.                 strUsers(Index) = Info
  35.                 System.Windows.Forms.Application.DoEvents()
  36.                
  37.                 For i = 0 To lstUsers.Items.Count
  38.                     If Me.lstUsers.Items(i) <> "" Then
  39.                         Call wskServer(Index).SendData("UserList " & lstUsers.Items(i))
  40.                         System.Windows.Forms.Application.DoEvents()
  41.                         System.Windows.Forms.Application.DoEvents()
  42.                     End If
  43.                     System.Windows.Forms.Application.DoEvents()
  44.                 Next i
  45.                 System.Windows.Forms.Application.DoEvents()
  46.                 'Call wskServer(Index).SendData("Welcome " & txtName.Text)
  47.                 'System.Windows.Forms.Application.DoEvents()
  48.                 'Call wskServer(Index).SendData("Msgday " & txtMessage.Text)
  49.                 '   System.Windows.Forms.Application.DoEvents()
  50.                
  51.                 'UPGRADE_WARNING: Couldn't resolve default property of object wskServer().UBound. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
  52.                 For i = 1 To wskServer().UBound
  53.                     If Not i = Index Then
  54.                         Call wskServer(i).SendData("Joined " & Info)
  55.                         System.Windows.Forms.Application.DoEvents()
  56.                     End If
  57.                     System.Windows.Forms.Application.DoEvents()
  58.                 Next i
  59.                
  60.             Case "Leave"
  61.                 'UPGRADE_WARNING: Couldn't resolve default property of object wskServer().UBound. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
  62.                 For i = 1 To wskServer().UBound
  63.                     If Not i = Index Then
  64.                         Call wskServer(i).SendData("Left " & Info)
  65.                         System.Windows.Forms.Application.DoEvents()
  66.                     End If
  67.                     System.Windows.Forms.Application.DoEvents()
  68.                 Next i
  69.                
  70.                 For i = 0 To lstUsers.Items.Count
  71.                     If Me.lstUsers.Items(i) = Info Then
  72.                         Call lstUsers.Items.RemoveAt(i)
  73.                         System.Windows.Forms.Application.DoEvents()
  74.                     End If
  75.                     System.Windows.Forms.Application.DoEvents()
  76.                 Next i
  77.                 System.Windows.Forms.Application.DoEvents()
  78.                
  79.                 If CheckUnKick(Info) = True Then
  80.                     For i = 0 To lstUnKickable.Items.Count
  81.                         If Me.lstUsers.Items(i) = Info Then
  82.                             Call lstUnKickable.Items.RemoveAt(i)
  83.                             System.Windows.Forms.Application.DoEvents()
  84.                         End If
  85.                     Next i
  86.                 End If
  87.                
  88.                 strUsers(Index) = ""
  89.                
  90.                 Num = Num - 1
  91.                 If Num < CDbl("0") Then Num = CInt("0")
  92.                 lblCount.Text = CStr(Num)
  93.                
  94.                 wskServer(Index).Close()
  95.                
  96.            
  97.         End Select
  98.     End Function

Client code: Code:
  1. Function obrada(ByRef strData As String) As Object
  2.         Dim i As Object
  3.         On Error Resume Next
  4.         Dim Umain, Msg, variable, UWin As Object
  5.         Dim Uball As String
  6.         Dim User, Command_Renamed, Info, Text_Renamed As String
  7.  
  8.         Command_Renamed = VB.Left(strData, InStr(strData, " ") - 1)
  9.         Info = VB.Right(strData, Len(strData) - InStr(strData, " "))
  10.  
  11.         Dim Answer As MsgBoxResult
  12.         Dim strUser As String
  13.         Dim msg3 As String
  14.         Dim msg4 As String
  15.         Dim msg5 As String
  16.         Select Case Command_Renamed
  17.  
  18.             Case "Message"
  19.                 User = VB.Left(Info, InStr(Info, ":") - 1)
  20.                 Text_Renamed = VB.Right(Info, Len(Info) - InStr(Info, ":"))
  21.                 System.Windows.Forms.Application.DoEvents()
  22.  
  23.                 Call AddChat(User, Text_Renamed)
  24.                 System.Windows.Forms.Application.DoEvents()
  25.          
  26.  
  27.  
  28.            
  29.              
  30.             Case "UserList"
  31.                 lstUsers.Items.Clear()
  32.                 Call lstUsers.Items.Add(Info)
  33.                 System.Windows.Forms.Application.DoEvents()
  34.  
  35.             Case "Joined"
  36.  
  37.                 'čitanje opcija
  38.  
  39.                 Call lstUsers.Items.Add(Info)
  40.  
  41.                 ' Opcije
  42.            
  43.  
  44.                 txtHistory.Document.DomDocument.write("<table cellspacing='0' cellpadding='0'><tr><td class='system'>[" & TimeOfDay & "] Server: " & Info & " has joined to Chat!!!</td></tr></table>")
  45.                 Me.txtHistory.Document.DomDocument.body.All(Me.txtHistory.Document.DomDocument.body.All.length - 1).scrollIntoView()
  46.                 System.Windows.Forms.Application.DoEvents()
  47.              
  48.  
  49.             Case "Left"
  50.                 For i = 0 To lstUsers.Items.Count
  51.                     If Me.lstUsers.Items(i) = Info Then
  52.                         Call lstUsers.Items.RemoveAt(i)
  53.                         System.Windows.Forms.Application.DoEvents()
  54.                     End If
  55.                     System.Windows.Forms.Application.DoEvents()
  56.                 Next i
  57.  
  58.                 txtHistory.Document.DomDocument.write("<table cellspacing='0' cellpadding='0'><tr><td class='system'>[" & TimeOfDay & "] Server: " & Info & " has logoff from the Chat!!!</td></tr></table>")
  59.                 Me.txtHistory.Document.DomDocument.body.All(Me.txtHistory.Document.DomDocument.body.All.length - 1).scrollIntoView()
  60.                
  61.          
  62.         End Select
  63.     End Function