当然有问题,
read += System.Text.Encoding.UTF8.GetString;
你要把上一次的数据连接起来,如果要不然每一次循环就把上一次的数据丢掉。

解决方案 »

  1.   

    还是不行,还是没把所有数据取完
    private void ReadMail(ref NetworkStream NetStream,int number)
    {
             int k=0;
    bool check=false;
    byte[] bb=new byte[Tcpclient.ReceiveBufferSize];


    while(!check)
    {
        k=NetStream.Read(bb,0,bb.Length);
                                   string read="";
        read +=System.Text.Encoding.UTF8.GetString(bb,0,k);
        int x=read.IndexOf("\r\n.\r\n");
        if(x!=1)
           {
               check=true;
           }
                                 }
                         }
      

  2.   

    System.Text.Encoding.UTF8  try to  change to other encoding format