Imports System.Net.Sockets Imports System.Text Public Class Form1 Dim clientSocket As
New System.Net.Sockets.TcpClient() Dim serverStream As NetworkStream Dim readData
As String Dim infiniteCounter As Integer Private Sub Button1_Click(ByVal sender As
System.Object, _ ByVal e As System.EventArgs) Handles Button1.Click Dim
outStream As Byte() = _ System.Text.Encoding.ASCII.GetBytes(TextBox2.Text + "$")
serverStream.Write(outStream, 0, outStream.Length) serverStream.Flush() End Sub
Private Sub msg() If Me.InvokeRequired Then Me.Invoke(New
MethodInvoker(AddressOf msg)) Else TextBox1.Text = TextBox1.Text + _
Environment.NewLine + " >> " + readData End If End Sub Private Sub
Button2_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles
Button2.Click readData = "Conected to Chat Server ..." msg()
clientSocket.Connect("127.0.0.1", 8888) 'Label1.Text = "Client Socket Program - Server
Connected ..." serverStream = clientSocket.GetStream() Dim outStream As Byte() =
_ System.Text.Encoding.ASCII.GetBytes(TextBox3.Text + "$")
serverStream.Write(outStream, 0, outStream.Length) serverStream.Flush() Dim
ctThread As Threading.Thread = _ New Threading.Thread(AddressOf getMessage)
ctThread.Start() End Sub Private Sub getMessage() For infiniteCounter = 1 To 2
infiniteCounter = 1 serverStream = clientSocket.GetStream() Dim buffSize As
Integer Dim inStream(10024) As Byte buffSize = clientSocket.ReceiveBufferSize
serverStream.Read(inStream, 0, buffSize) Dim returndata As String = _
System.Text.Encoding.ASCII.GetString(inStream) readData = "" + returndata
msg() Next End Sub End Class
Solution
Imports System.Net.Sockets Imports System.Text Public Class Form1 Dim clientSocket As
New System.Net.Sockets.TcpClient() Dim serverStream As NetworkStream Dim readData
As String Dim infiniteCounter As Integer Private Sub Button1_Click(ByVal sender As
System.Object, _ ByVal e As System.EventArgs) Handles Button1.Click Dim
outStream As Byte() = _ System.Text.Encoding.ASCII.GetBytes(TextBox2.Text + "$")
serverStream.Write(outStream, 0, outStream.Length) serverStream.Flush() End Sub
Private Sub msg() If Me.InvokeRequired Then Me.Invoke(New
MethodInvoker(AddressOf msg)) Else TextBox1.Text = TextBox1.Text + _
Environment.NewLine + " >> " + readData End If End Sub Private Sub
Button2_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles
Button2.Click readData = "Conected to Chat Server ..." msg()
clientSocket.Connect("127.0.0.1", 8888) 'Label1.Text = "Client Socket Program - Server
Connected ..." serverStream = clientSocket.GetStream() Dim outStream As Byte() =
_ System.Text.Encoding.ASCII.GetBytes(TextBox3.Text + "$")
serverStream.Write(outStream, 0, outStream.Length) serverStream.Flush() Dim
ctThread As Threading.Thread = _ New Threading.Thread(AddressOf getMessage)
ctThread.Start() End Sub Private Sub getMessage() For infiniteCounter = 1 To 2
infiniteCounter = 1 serverStream = clientSocket.GetStream() Dim buffSize As
Integer Dim inStream(10024) As Byte buffSize = clientSocket.ReceiveBufferSize
serverStream.Read(inStream, 0, buffSize) Dim returndata As String = _
System.Text.Encoding.ASCII.GetString(inStream) readData = "" + returndata
msg() Next End Sub End Class

More Related Content

DOCX
.net progrmming part4
PPTX
Colegio municipal
PDF
Inventory management
DOC
Elementos del lenguaje
PDF
Visual Studio.Net - Sql Server
DOC
Calculadora
PDF
SISTEMA DE FACTURACION (Ejemplo desarrollado)
DOC
Ficha tecnica
.net progrmming part4
Colegio municipal
Inventory management
Elementos del lenguaje
Visual Studio.Net - Sql Server
Calculadora
SISTEMA DE FACTURACION (Ejemplo desarrollado)
Ficha tecnica

Similar to Imports System.Net.Sockets Imports System.Text Public Class Form1 .pdf (20)

PPTX
Latihan visual basic 2010/Looping/Perulangan
PDF
Ejercicio sql server vs visual .net
PDF
Form1.vb
PDF
VB net lab.pdf
DOCX
Codes
DOC
Correction s+ rie_vb
PDF
Imports System.Data.OleDb Public Class Form1 Dim connc As Ne.pdf
PDF
Membuat aplikasi penjualan buku sederhana
DOCX
DOCX
Puerto serialarduino
PPT
.Net Enterprise Services and their Implementations
DOCX
INSERCION DE REGISTROS DESDE VISUAL.NET A UNA BD DE SQL SERVER
DOCX
โครงการ 5 บท
DOCX
โครงการ 5 บท
PDF
Aplikasi rawat-inap-vbnet
PDF
Calculator code
DOCX
Código Editor Net
PDF
DOT NET LAB PROGRAM PERIYAR UNIVERSITY
DOCX
Ensayo Convergencia Informatica
Latihan visual basic 2010/Looping/Perulangan
Ejercicio sql server vs visual .net
Form1.vb
VB net lab.pdf
Codes
Correction s+ rie_vb
Imports System.Data.OleDb Public Class Form1 Dim connc As Ne.pdf
Membuat aplikasi penjualan buku sederhana
Puerto serialarduino
.Net Enterprise Services and their Implementations
INSERCION DE REGISTROS DESDE VISUAL.NET A UNA BD DE SQL SERVER
โครงการ 5 บท
โครงการ 5 บท
Aplikasi rawat-inap-vbnet
Calculator code
Código Editor Net
DOT NET LAB PROGRAM PERIYAR UNIVERSITY
Ensayo Convergencia Informatica
Ad

More from apnashop1 (20)

PDF
0 repersent even 1 for odd parity bitSolution0 repersent eve.pdf
PDF
(1) What is the purpose of a VLAN trunkAns) A trunk is a line or .pdf
PDF
viscosity and surface tension are both related to.pdf
PDF
What is Fluorescence Electrons in an atom or a m.pdf
PDF
The F- will react with water to form HF and OH F-.pdf
PDF
The compound is neutral. The Ammonium ion (NH4+) .pdf
PDF
Step1 NaF is the correct answer Step2 Na+ + e --.pdf
PDF
SO3 wont react with molecular oxygen because in S.pdf
PDF
Milk neutralises the basics formed. .pdf
PDF
Li + 2H2O = Li(OH)2 + 2H2 moles of Li =1.0502 Mo.pdf
PDF
In mathematics, if G is a group, and H is a subgr.pdf
PDF
Use of technology and innovation in Healthcare centerSolutionU.pdf
PDF
There are 22 different cuttings.The number of possible tiling of t.pdf
PDF
Sorry for the late response, but please rate!SolutionS.pdf
PDF
PbTlAtBaSolutionPbTlAtBa.pdf
PDF
Option D is the correct answer. As the morphogen is responsible for .pdf
PDF
d. Al2S3 note Al is in oxidation state of +3, a.pdf
PDF
increasing.Solutionincreasing..pdf
PDF
In number of government and private case studies include that the in.pdf
PDF
Benzoic Acid is insoluble in nonpolar solvents li.pdf
0 repersent even 1 for odd parity bitSolution0 repersent eve.pdf
(1) What is the purpose of a VLAN trunkAns) A trunk is a line or .pdf
viscosity and surface tension are both related to.pdf
What is Fluorescence Electrons in an atom or a m.pdf
The F- will react with water to form HF and OH F-.pdf
The compound is neutral. The Ammonium ion (NH4+) .pdf
Step1 NaF is the correct answer Step2 Na+ + e --.pdf
SO3 wont react with molecular oxygen because in S.pdf
Milk neutralises the basics formed. .pdf
Li + 2H2O = Li(OH)2 + 2H2 moles of Li =1.0502 Mo.pdf
In mathematics, if G is a group, and H is a subgr.pdf
Use of technology and innovation in Healthcare centerSolutionU.pdf
There are 22 different cuttings.The number of possible tiling of t.pdf
Sorry for the late response, but please rate!SolutionS.pdf
PbTlAtBaSolutionPbTlAtBa.pdf
Option D is the correct answer. As the morphogen is responsible for .pdf
d. Al2S3 note Al is in oxidation state of +3, a.pdf
increasing.Solutionincreasing..pdf
In number of government and private case studies include that the in.pdf
Benzoic Acid is insoluble in nonpolar solvents li.pdf
Ad

Recently uploaded (20)

PDF
gsas-cvs-and-cover-letters jhvgfcffttfghgvhg.pdf
PDF
Jana-Ojana Finals 2025 - School Quiz by Pragya - UEMK Quiz Club
PDF
BÀI GIẢNG POWER POINT TIẾNG ANH 6 - I LEARN SMART WORLD - CẢ NĂM - NĂM 2025 (...
PDF
2003-theological-education-v39-n1-tai lieu
PPTX
Power of Gratitude: Honouring our teachers
PDF
IS1343_2012...........................pdf
PPTX
Environmental Sciences and Sustainability Chapter 2
PDF
horaris de grups del curs 2025-2026 de l'institut
PDF
HSE and their team are going through the hazards of the issues with learning ...
PDF
Unleashing the Potential of the Cultural and creative industries
PDF
HSE 2022-2023.pdf الصحه والسلامه هندسه نفط
PDF
Insight into Romanian Wild-Grown Heracleum sphondylium: Development of a New ...
PDF
Teacher's Day Quiz 2025
PDF
V02-Session-4-Leadership-Through-Assessment-MLB.pdf
PDF
[Medicalstudyzone.com] 1. AIIMS NOV EMBER 2015 SOLVED PAPER.pdf
PDF
New_Round_Up_6_SB.pdf download for free, easy to learn
PDF
Developing speaking skill_learning_mater.pdf
PPTX
Ppt obs emergecy.pptxydirnbduejguxjjdjidjdbuc
PDF
Jana Ojana 2025 Prelims - School Quiz by Pragya - UEMK Quiz Club
gsas-cvs-and-cover-letters jhvgfcffttfghgvhg.pdf
Jana-Ojana Finals 2025 - School Quiz by Pragya - UEMK Quiz Club
BÀI GIẢNG POWER POINT TIẾNG ANH 6 - I LEARN SMART WORLD - CẢ NĂM - NĂM 2025 (...
2003-theological-education-v39-n1-tai lieu
Power of Gratitude: Honouring our teachers
IS1343_2012...........................pdf
Environmental Sciences and Sustainability Chapter 2
horaris de grups del curs 2025-2026 de l'institut
HSE and their team are going through the hazards of the issues with learning ...
Unleashing the Potential of the Cultural and creative industries
HSE 2022-2023.pdf الصحه والسلامه هندسه نفط
Insight into Romanian Wild-Grown Heracleum sphondylium: Development of a New ...
Teacher's Day Quiz 2025
V02-Session-4-Leadership-Through-Assessment-MLB.pdf
[Medicalstudyzone.com] 1. AIIMS NOV EMBER 2015 SOLVED PAPER.pdf
New_Round_Up_6_SB.pdf download for free, easy to learn
Developing speaking skill_learning_mater.pdf
Ppt obs emergecy.pptxydirnbduejguxjjdjidjdbuc
Jana Ojana 2025 Prelims - School Quiz by Pragya - UEMK Quiz Club

Imports System.Net.Sockets Imports System.Text Public Class Form1 .pdf

  • 1. Imports System.Net.Sockets Imports System.Text Public Class Form1 Dim clientSocket As New System.Net.Sockets.TcpClient() Dim serverStream As NetworkStream Dim readData As String Dim infiniteCounter As Integer Private Sub Button1_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles Button1.Click Dim outStream As Byte() = _ System.Text.Encoding.ASCII.GetBytes(TextBox2.Text + "$") serverStream.Write(outStream, 0, outStream.Length) serverStream.Flush() End Sub Private Sub msg() If Me.InvokeRequired Then Me.Invoke(New MethodInvoker(AddressOf msg)) Else TextBox1.Text = TextBox1.Text + _ Environment.NewLine + " >> " + readData End If End Sub Private Sub Button2_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles Button2.Click readData = "Conected to Chat Server ..." msg() clientSocket.Connect("127.0.0.1", 8888) 'Label1.Text = "Client Socket Program - Server Connected ..." serverStream = clientSocket.GetStream() Dim outStream As Byte() = _ System.Text.Encoding.ASCII.GetBytes(TextBox3.Text + "$") serverStream.Write(outStream, 0, outStream.Length) serverStream.Flush() Dim ctThread As Threading.Thread = _ New Threading.Thread(AddressOf getMessage) ctThread.Start() End Sub Private Sub getMessage() For infiniteCounter = 1 To 2 infiniteCounter = 1 serverStream = clientSocket.GetStream() Dim buffSize As Integer Dim inStream(10024) As Byte buffSize = clientSocket.ReceiveBufferSize serverStream.Read(inStream, 0, buffSize) Dim returndata As String = _ System.Text.Encoding.ASCII.GetString(inStream) readData = "" + returndata msg() Next End Sub End Class Solution Imports System.Net.Sockets Imports System.Text Public Class Form1 Dim clientSocket As New System.Net.Sockets.TcpClient() Dim serverStream As NetworkStream Dim readData As String Dim infiniteCounter As Integer Private Sub Button1_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles Button1.Click Dim outStream As Byte() = _ System.Text.Encoding.ASCII.GetBytes(TextBox2.Text + "$") serverStream.Write(outStream, 0, outStream.Length) serverStream.Flush() End Sub Private Sub msg() If Me.InvokeRequired Then Me.Invoke(New MethodInvoker(AddressOf msg)) Else TextBox1.Text = TextBox1.Text + _ Environment.NewLine + " >> " + readData End If End Sub Private Sub Button2_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles Button2.Click readData = "Conected to Chat Server ..." msg() clientSocket.Connect("127.0.0.1", 8888) 'Label1.Text = "Client Socket Program - Server
  • 2. Connected ..." serverStream = clientSocket.GetStream() Dim outStream As Byte() = _ System.Text.Encoding.ASCII.GetBytes(TextBox3.Text + "$") serverStream.Write(outStream, 0, outStream.Length) serverStream.Flush() Dim ctThread As Threading.Thread = _ New Threading.Thread(AddressOf getMessage) ctThread.Start() End Sub Private Sub getMessage() For infiniteCounter = 1 To 2 infiniteCounter = 1 serverStream = clientSocket.GetStream() Dim buffSize As Integer Dim inStream(10024) As Byte buffSize = clientSocket.ReceiveBufferSize serverStream.Read(inStream, 0, buffSize) Dim returndata As String = _ System.Text.Encoding.ASCII.GetString(inStream) readData = "" + returndata msg() Next End Sub End Class