日期:2014-05-17 浏览次数:20829 次
TcpClient client = new TcpClient("127.0.0.1", 5567);
NetworkStream sendStream = client.GetStream();
String msg = textBox2.Text;
//Byte[] sendBytes = Encoding.Default.GetBytes(msg);
byte[] sendBytes = Encoding.ASCII.GetBytes(msg);
sendStream.Write(sendBytes,0,sendBytes.Length);
sendStream.Close();
client.Close();