我的代码连接到 pop.gmail.com 服务器并发送一些命令,但没有从服务器接收任何数据。这是我的代码`
public TcpClient Server;
public NetworkStream NetStrm;
public StreamReader RdStrm;
public string Data;
public byte[] szData;
public string CRLF = "\r\n";
public string Status;
// initialization
NetStrm = Server.GetStream();
RdStrm = new StreamReader(Server.GetStream());
Status += RdStrm.ReadLine();
// Login Process
Data = "USER aaaaaaaa@gmail.com" + CRLF;
szData = System.Text.Encoding.ASCII.GetBytes(Data.ToCharArray());
NetStrm.Write(szData, 0, szData.Length);
Status += RdStrm.ReadLine();
Console.WriteLine(Status);
当我调试时,有一条消息“无法从传输连接读取数据:已建立的连接被主机中的软件中止。”
哪个是问题?