You can scrap a lot of that code just by using a BitArray to do the conversion:
bool[] array = new bool[8];
array[1] = true;
array[3] = true;
array[6] = true;
array[7] = true;
BitArray bytes = new BitArray(array);
byte[] byteArray = new byte[1];
bytes.CopyTo(byteArray, 0);
You can then write the array of bytes to a file, though, it's not going to be text so I don't know why you're trying to use a text file.
You can even just skip the bool[] array and just use the BitArray to hold all the bool values.
BitArray bits = new BitArray(8);
bits[1] = true;
bits[3] = true;
bits[6] = true;
bits[7] = true;
byte[] byteArray = new byte[1];
bits.CopyTo(byteArray, 0);