title: How to validate user input for whether it's an integer?
body: <p>It tells me that it can't convert int to bool.
  Tried TryParse but for some reason the argument list is invalid.</p>
  
  <p>Code:</p>
  
  <pre><code>private void SetNumber(string n)
  {
      // if user input is a number then
      if (int.Parse(n)) 
      {
          // if user input is negative
          if (h &lt; 0)
          {
              // assign absolute version of user input
              number = Math.Abs(n); 
          }
          else 
          {
              // else assign user input
              number = n;
          }
      }
      else
      {
          number = 0; // if user input is not an int then set number to 0  
      }
  }
  </code></pre>