Quote:
actually a client is a device,this device send me a binary data but my code shows me a garbage values like ??A@ and some other characters. how to read binary data from device and display the data in textbox.
And then you do this:
string aa = sr.ReadLine();
Which says "treat the incoming data as Unicode characters and garble it all up for me, please. If there are any lines in there, anyway."
If you are receiving binary data, then handle it as binary data:
int bytesCount = sr.Length;
byte[] data = new byte[bytesCount];
int actuallyRead = sr.Read(data, 0, bytesCount);
Then process the data according to the documentation for the actual device.
You need to use the device documentation as there is no "standard" that applies across all devices.