static String BitArrayToStr(BitArray ba) { byte[] strArr = new byte[ba.Length / 8]; System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding(); for (int i = 0; i < ba.Length / 8; i++) { for (int index = i * 8, m = 1; index < i * 8 + 8; index++, m *= 2) { strArr[i] += ba.Get(index) ? (byte)m : (byte)0; } } return encoding.GetString(strArr); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)