string ByteToStr(byte b) { string result = ""; byte a = b; ; for (int i = 0; i < 8; i++) { byte c = a; a = (byte)(a<<1); a = (byte)(a >> 1); if (a == c) result += "0"; else result += "1"; a = (byte)(a << 1); } return result; } for:byte b=0x35 result:"110101"