title: Read string from TcpClient
body: <p>So I am having trouble reading my string sent through a Tcp stream. I am using this code to send.</p>
  
  <pre><code>byte[] bytes = ASCIIEncoding.ASCII.GetBytes("connect");
  NetworkStream stream = client.GetStream();
  StreamWriter writer = new StreamWriter(stream);
  writer.Write(bytes);
  writer.Close();
  </code></pre>
  
  <p>And this code to read:</p>
  
  <pre><code>public void getConnectionString()
  {
  
      NetworkStream ns = client.GetStream();
  
      byte[] bytes = new byte[client.ReceiveBufferSize];
      ns.Read(bytes, 0, bytes.Length);
      string info = Encoding.ASCII.GetString(bytes);
      MessageBox.Show(info);
  }
  </code></pre>
  
  <p>But all this is returning is System: byte[]</p>
  
  <p>Shouldn't it return the string? What am I doing wrong?</p>