void writestreamdata(string data) { byte[] bytes = System.Text.ASCIIEncoding.UTF8.GetBytes(data); stream.Write(bytes, 0, bytes.Length); }