Jump to content
Xtreme .Net Talk

[VB .NET] Receive a message by a Client


Recommended Posts

Guest Brainforce
Posted

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...