title: GeoIpLocation - How to get State and County? (OR, how to get State and County from a zip code) C#
body: <p>I'm using a method to get an IipLocation object from an IP address. This is the code that returns the Location object:</p>
  
  <pre><code>public IIpLocation GetIpLocation(IPAddress ipAddress)
  {
      ipAddress.CheckNull("ipAddress");
  
      IIpLocation ipLocation = null;
      try
      {
          //Try to look up the location using MaxMind.
          Location location = GetMaxMindIpLocation(ipAddress);
  
          //If the postal code is not present, then try to look it up with GeoNames.
          if (location != null &amp;&amp; (location.PostalCode == null || location.PostalCode.Equals("")))
          {
              location.PostalCode = GetPostalCodeFromGeoNames(location);
          }
  
          if (location != null)
          {
              ipLocation = new GeoIpLocation(location);
          }
      }
      catch (NullReferenceException)
      {
          Log.ErrorFormat(Resources.log_maxMindLookupFailed, ipAddress);
      }
  
      return ipLocation;
  }
  </code></pre>
  
  <p>The IipLocation object has the following properties: <code>Region</code>, <code>RegionName</code>, <code>CountryCode</code>, <code>City</code>, <code>Postal Code</code>, <code>Latitude</code>, <code>Longitude</code>. However, I need the State and County. How can I get the state and county from the information that I have?</p>