tags:

views:

7

answers:

1

I am trying to send an Arraylist over to my server to broadcast to all other clients but I am not sure after serializing it, how do I proceed to send across. This is what I have here:

    Private Sub Button1_Click(ByVal sender As System.Object, _
        ByVal e As System.EventArgs) Handles Button1.Click

        Dim BinFormatter As New Binary.BinaryFormatter()
        Dim FS As New System.IO.FileStream("c:\test.txt", IO.FileMode.Create)

        Dim i As Integer
        Dim f As Integer
        Dim listchkBox As New ArrayList()
        For Each ctrl As Control In Me.Controls
            Dim chkbox As CheckBox
            If TypeOf ctrl Is CheckBox Then
                i += 1
                chkbox = ctrl
                If chkbox.Checked = True Then
                    listchkBox.Add(i)
                End If
            End If
        Next
        For f = 0 To listchkBox.Count - 1
            MsgBox(listchkBox.Item(f))
        Next

        BinFormatter.Serialize(FS, listchkBox)

       ' I am not sure if I am doing right after this 
       ' line I am not sure how to pack it into a stream and 
       ' send across, please advice...

End Sub

Thanks!

A: 

You should have a look at Remoting or WCF.

A quick search on Stackoverflow gave this, which should give a very basic idea of how to use it:

http://stackoverflow.com/questions/1405418/net-remoting-helloworld

Krumelur