OK, this is a minor issue… but still irritating nonetheless.
In MSVS 2008 .NET 3.5 I IPAdress.Address was a long and I simply used
if(subnet == subnetmask.Address & addr.Address) { ... }
And then now i just installed MSVS 2010, still using .NET 3.5 but somehow it tells me the IPAddress.Address is obsolete.
I can still wrap a BitConvertor in BitConverter.ToInt64(subnet.GetAddressBytes(), 0) but it feels like i am going backwards. Is there a more elegant way or a built-in function to check for subnet?
Thanks.
The reason for
IPAddress.Addressto be marked as obsolete is:With IPv6 coming, depending on specific features of IPv4 should be regarded as obsolete. Your workaround has the same problem – dependency on IPv4. I think that you have two options: