How come I cannot get my VB code to send a picture from one computer to another?

by on January 10, 2011

Q: On one of the programs I’m making I’m trying to send a picture from one computer to another. The programming language is vb here is what I have so far

controller
————–
Try
If listener.Pending = True Then
client = listener.AcceptTcpClient()
Dim reader As New StreamReader(client.GetStream())
While reader.Peek > -1
message = message + Convert.ToChar(reader.Read()).ToString

End While
Me.Focus()
PictureBox1.Image = Image.FromStream
End If
Catch ex As Exception

End Try

—————
unfortunately i get an error
here’s the other part of the application (non controller)
————————————————-

Try
client = New TcpClient(TextBox4.Text, 44444)
Dim writer As New StreamWriter(client.GetStream())
writer.Write(PictureBox1.Image)
writer.Flush()
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Critical)

————————————————————————

help please!!