用TCP实现的一个简单的局域网聊天工具 TcpClient newclient = new TcpClient(); newclient.Connect(sSendIP, 4002); NetworkStream stm = newclient.GetStream(); byte[] sendBytes = Encoding.UTF8.GetBytes(txtInfo.Text);