title: Check if Ip address in range
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/2138706/how-to-check-a-input-ip-fall-in-a-specific-ip-range">How to check a input IP fall in a specific IP range</a>  </p>
  </blockquote>
  
  
  
  <p>I would like to check if a Ip address is in range of private Ip addresses. I do not find any method in .NET and I am not sure how to build it by myself?</p>
  
  <p>For example <code>CheckIsIpPublic("192.168.0.1", upperIp, lowerIp) //should return false</code></p>
  
  <p>For example <code>CheckIsIpPublic("78.60.143.29", upperIp, lowerIp) //should return true</code></p>
  
  <pre><code>var upperIp = new List&lt;IPAddress&gt;
               {
                 IPAddress.Parse("192.168.0.0"),
                 IPAddress.Parse("10.0.0.0"),
                 IPAddress.Parse("172.16.0.0"),
                 IPAddress.Parse("224.0.0.0")
               };
  
  var lowerIp = new List&lt;IPAddress&gt;
               {
                 IPAddress.Parse("192.168.255.255"), 
                 IPAddress.Parse("10.255.255.255"), 
                 IPAddress.Parse("172.31.255.255"), 
                 IPAddress.Parse("255.255.255.255")
               };
  </code></pre>