The elegant way is get both the subnet address and the IP address as 32-bit
unsigned integers, and AND them together. If the result equals the subnet,
it's on the subnet.
HTH,
Tom Dacon
"Terry Olsen" <to******@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
Is there an "elegant" way to determine if an IP address is on my subnet?
Or do I just compare the first 2 or 3 octets?