Converting from string bits to byte or hex

.net, c#

Solution

This should do it:

string binaryText = "1101000";
int value1 = Convert.ToInt32(binaryText, 2) // 104
byte value2 = Convert.ToByte(binaryText, 2); // 104

Problem

I have a string that contains the following 7 bits: 1101000. How can I convert it to a byte or int?

Original source