Byte array cannot be converted to String for sending over UDP
Posted on 2004-10-11
Basically I'm reading in a file (wav, text, jpg etc) for transfer over UDP
Dim objBr As New BinaryReader(File.OpenRead(FilenameGoesHere))
Dim bytFile As Byte() = objBr.ReadBytes(objBr.BaseStream.Length)
xSock.UDP_Send(txtIPIn.Text, 10090, bytFile)
Then I try to send the array (stored in bytFile) I get this message:
"Value of type '1-dimensional array of Byte' cannot be converted to 'String'."
I've tried a few different things but nothing works. I am assuming that converting a binary file to string isn't a good idea. Is there a way round this or an alternate method of sending the files using UDP rather than TCP/IP ?