title: Convert binary to int
body: <p>I want to convert my text into binary and to XOR it with some value, but i get an error: </p>
  
  <blockquote>
    <p>System.InvalidCastException: Unable to cast object of type
    'System.Text.StringBuilder' to type 'System.IConvertible'.</p>
  </blockquote>
  
  <p>My code is: </p>
  
  <pre><code>        public static string StringToBinary(string data)
          {
              StringBuilder sb = new StringBuilder();
  
              foreach (char c in data.ToCharArray())
              {
                  sb.Append(Convert.ToString(c, 2).PadLeft(8, '0'));
              }
              var abc = Convert.ToInt32(sb);
              var k = abc ^ 210;
              return k.ToString();
  
          }
  </code></pre>
  
  <p>Looks like I can't convert binary to int. Is there other way to do this? </p>