分享一个二进制转字符串的方法

 1 public string ByteToString(byte[] inputBytes)
 2 {
 3     StringBuilder temp = new StringBuilder(2048);
 4     foreach (byte tempByte in inputBytes)
 5     {
 6         temp.Append(tempByte > 15 ?
 7         Convert.ToString(tempByte, 2) : '0' + Convert.ToString(tempByte, 2));
 8     }
 9     return temp.ToString();
10 }
原文地址:https://www.cnblogs.com/YangFei-wow/p/3724939.html