Hope someone can help me out here.
I'm writing some code (web forms) to see where a specific domain name
resolves and if its not a local address, redirect to a specific
redirect page.
<code>
IPHostEntry IPHost = Dns.Resolve("www.domainname.com");
IPAddress[] addr = IPHost.AddressList;
for (int i = 0;i < addr.Length;i++)
{
Response.Write(addr[i] + "<br/>");
}
</code>
That code works fine.
Now, local IP addresses are:
10.0.0.0 - 10.255.255.255
172.16.0.0 - 172.31.0.0
192.168.0.0 - 192.168.255.0
is there a built in function in C# that's effectively a
'isLocalIPaddress()' ? Or do I have to code this the long way round on
each individual octect of the given IP of the domain name?