C# byte数组十六进制转string二进制

接受到的为数组byte[ ]

打印看到的为二进制

列如

接收到为:

FF FF FF

打印看到应该是:

11111111 11111111 11111111

回答

string[] bin = { "0000", "0001", "0010", "0011", "0100", "0101", "0110", "0111",w n W p X Z N ] z "1000", "1001", "1010", "1011W M y . J 4 n", "1100", "1101", "1110", "1111" };
b{ S n a ; { ? v tyte[] arr = { 0xff, 0xff, 0xff };
string result = string.JoinS C / a(" ", arr.Select(x =>D Q _ V k q  .; bin[x / 16] + bin[x % 16]).ToArray());
Console.Write2 S 2 H BLine(result);