title: Convert.ChangeType from int to bool
body: <p>Using the following to get values from query string and convert to specific types should there be a need.</p>
  
  <pre><code>public static T Convert&lt;T&gt;(NameValueCollection QueryString, string KeyName, T DefaultValue) where T : IConvertible
      {
          //Get the attribute
          string KeyValue = QueryString[KeyName];
  
          //Not exists?
          if (KeyValue == null) return DefaultValue;
  
          //Empty?
          if (KeyValue == "") return DefaultValue;
  
          //Convert
          try
          {
              return (T)System.Convert.ChangeType(KeyValue, typeof(T));
          }
          catch
          {
              return DefaultValue;
          }
      } 
  </code></pre>
  
  <p>A call would be made as such</p>
  
  <pre><code>int var1 = Convert&lt;int&gt;(HttpContext.Current.Request.QueryString,"ID", 0);
  </code></pre>
  
  <p>However when trying to do the following it does not work correctly so my question is, is it possible to change the code to handle bools if the value being retrieved from the querystring variable is a 1 or a 0 instead of a true of false.</p>
  
  <pre><code>ie... instead of
  http://localhost/default.aspx?IncludeSubs=true
  the call is
  http://localhost/default.aspx?IncludeSubs=1
  
  bool var1 = Convert&lt;bool&gt;(HttpContext.Current.Request.QueryString,"IncludeSubs", false);
  </code></pre>