title: Convert Boolean to Integer in VB.NET
body: <p>Take the following code:</p>
  
  <pre><code>Sub Main()
  
      Dim i As Integer
      Dim b As Boolean
  
      i = 1
      b = i
      i = b
      Console.WriteLine(i)
  
      i = Convert.ToInt32(b)
      Console.WriteLine(i)
  
  End Sub
  </code></pre>
  
  <p>This prints the following:</p>
  
  <pre><code>-1
  1
  </code></pre>
  
  <p>Why is this?</p>
  
  <p>(Just a joke :) You can get 0 too...</p>
  
  <pre><code>Int32.TryParse("True", i)
  Console.WriteLine(i)
  </code></pre>