Results 1 to 2 of 2

Thread: Send Listbox by Winsock

  1. #1
    yakie
    Guest

    Send Listbox by Winsock

    I use a list box to store the user names in the server side of my VB program. i was wondering how can i send the whole list of user names or the user name listbox to my client side of my VB program?

  2. #2
    Hyperactive Member
    Join Date
    Apr 2002
    Location
    uk
    Posts
    327
    Well, the simplest way would be this:
    Code:
    Dim i As Integer
    For i = 0 To List1.ListCount - 1
      If Winsock.State = sckConnected Then
        Winsock.SendData List1.List(i)
        DoEvents
      End If
    Next i
    Your client would receive it like this:
    Code:
    Private Sub Winsock_DataArrival(ByVal BytesTotal As Long)
    Dim Data As String
      Winsock.GetData Data
      MsgBox Data
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width