0

Hi i want to send an multiple screenshot image.. and i want them to send one by one from my client to server.. Can you please post some code.. im using vs2008.

Thanks Ahead.. God Bless

2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by Mitja Bonca
0

Hi, you will have to use convert image to a byte array and then back to image.

'server/write
        Dim len As Long = sendBytes.Length

        Dim Bytelen() As Byte = BitConverter.GetBytes(len)
        'send the size of Data first
        networkStream.Write(Bytelen, 0, Bytelen.Length)
        'add write size of Data 2011/3/3

        networkStream.Write(sendBytes, 0, sendBytes.Length)
'-----------------------------------------------------------------------
          'client/read
          ' add read size of Data 2011/3/3
          Dim len As Long
          Dim byteLen(8) As Byte
          'read the size of data
          networkStream.Read(byteLen, 0, 8)
          len = BitConverter.ToInt64(byteLen, 0)
          ' add read size of Data 2011/3/3

          'Dim bytes(tcpClient.ReceiveBufferSize) As Byte
          Dim bytes(len) As Byte

          'networkStream.Read(bytes, 0, CInt(tcpClient.ReceiveBufferSize))
          networkStream.Read(bytes, 0, len)
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.