Vb.net TCP can';无法连接到本地服务器

Vb.net TCP can';无法连接到本地服务器,vb.net,tcp,Vb.net,Tcp,我在visual basic中遇到TCP问题,因为我遇到以下错误: “发送”不是的成员 “System.Net.Sockets.TcpClient”。C:\Users\Nathan\Desktop\Launcher\WindowsApplication1\WindowsApplication1\Elite Team Launcher.vb 56 21 Windows应用程序1 代码如下: Dim client As New TcpClient client.Connect("192.168.1.

我在visual basic中遇到TCP问题,因为我遇到以下错误:

“发送”不是的成员 “System.Net.Sockets.TcpClient”。C:\Users\Nathan\Desktop\Launcher\WindowsApplication1\WindowsApplication1\Elite Team Launcher.vb 56 21 Windows应用程序1

代码如下:

Dim client As New TcpClient
client.Connect("192.168.1.103", 7775)
Dim sendbytes() As Byte = System.Text.Encoding.ASCII.GetBytes(TextBox1.Text)
client.Send(sendbytes, 0, sendbytes.Length)

不要使用
Send
。您需要在从
GetStream
返回的
流上使用
Write

您可以在这里看到如何正确使用
TcpClient


然后出现错误1“Write”不是“System.Net.Sockets.TcpClient”的成员。C:\Users\Nathan\Desktop\Launcher\WindowsApplication1\WindowsApplication1\Elite Team Launcher.vb 56 21WindowsApplication1@Nathaniel例如再读一遍他的答案。“对从
GetStream
返回的流使用
Write