How to save string contains of 1 and 0 to bin file? <p>Hi I have string str="1010101010101010" comes from file.txt which contains exactly 16 signs: 0 and 1.This is only an example and str can have more than 16 signs: 8,16,24,32,40... I want to save it to file.bin. After saving file.bin must have size 2B(in this example). I tried to use </p> <pre><code>File.WriteAllText(path, str); </code></pre> <p>but my file is bigger than i want. Can someone help me?</p>