私が探しているのは、単純なTCPClient/Listner( "hello world")の例です。私は初心者で、Microsoft TCPClient/Listnerクラスの例は私が探しているものではありません。私が探しているのは、TCPClientがメッセージ「Hello world」を送信し、TCPListenerがメッセージを取得し、「Hello world message」を返すということです。単純なTCPClient/Listner( "hello world")の例
少しの助けが素晴らしいでしょう。私が持っているのは、 "Hello World"を送信するTCPClientです。これは効果がありますか?
Dim port As Int32 = 13000
Dim client As New TcpClient("192.168.0.XXX", port)
' Translate the passed message into ASCII and store it as a Byte array.
Dim data As [Byte]() = System.Text.Encoding.ASCII.GetBytes("Hello World")
' Get a client stream for reading and writing.
' Stream stream = client.GetStream();
Dim stream As NetworkStream = client.GetStream()
' Send the message to the connected TcpServer.
stream.Write(data, 0, data.Length)
Yes..thatは、送信するため問題ないはずです。実際のプロトコルがないと仮定します(ほとんどの時間が存在します)。しかし、受信は、人々が考えるよりもずっと複雑です。私の[記事](http://www.experts-exchange.com/Programming/Languages/.NET/Visual_Basic.NET/A_11178-A-Peer-To-Peer-LAN-Chat-Application-in)に興味があるかもしれません。 -Visual-Basic-Net-TcpClient-and-TcpListener.html)をEEで使用します。 –
そのリンクは本当に助けになった!ありがとう!! –