首先
public class ClientConnection : TcpClient
{
private NetworkStream _NetworkStream = null;
private StreamReader _StreamReader = null;
private StreamWriter _StreamWriter = null;
public void Initialise()
{
_NetworkStream = this
_StreamReader = new StreamReader(_NetworkStream
System
_StreamWriter = new StreamWriter(_NetworkStream
System
}
public void Send(string s)
{
_StreamWriter
_StreamWriter
}
public string Read()
{
return _StreamReader
}
}
From:http://tw.wingwit.com/Article/program/ASP/201311/21663.html