[VB .NET] Receive a message by a Client

  • Thread starter Thread starter Brainforce
  • Start date Start date
B

Brainforce

Guest
Hallo, my name is Mark and i'm an italian boy soo excuse me for my poor english.

Take a look at this problem.

I have a Client thas send a message text to a server, but i dont know how i can get this message and put in in a textbox.

This is my source code of the server

#code

Imports System.Net.Sockets
Imports System.Text

Public Class Form1
Inherits System.Windows.Forms.Form

Const PORT_NUM As Integer = 10000

Private server As TcpListener

Private Sub avvia_server_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles avvia_server.Click
server = New TcpListener(PORT_NUM)
server.Start()
End Sub

Private Sub spegni_server_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles spegni_server.Click
server.Stop()
End Sub
End Class

The server now start to listener on port 10000 when i click on one button, and stop to listener when i click another one, how i can receive a message and put it in one text.box?

Thanks very much.
 
Back
Top