At a loss figuring out if an IP is on LAN or INET
- From: "Terry Olsen" <tolsen64@xxxxxxxxxxx>
- Date: Thu, 27 Apr 2006 22:03:07 -0600
I'm writing an app that communicates with computers both inside and outside
my router. So I need to determine by the remote host's IP address if I need
to send them my LAN IP or my Internet IP. Someone suggested AND'ing the IP
and my Subnet Mask but I come up with this:
My IP: 192.168.0.14
Mask: 255.255.255.0
Result: 192.168.0.0
Should I just compare the first two octets? Or are there situations where
this would provide incorrect results?
.
- Follow-Ups:
- Re: At a loss figuring out if an IP is on LAN or INET
- From: david
- Re: At a loss figuring out if an IP is on LAN or INET
- From: Cor Ligthert [MVP]
- Re: At a loss figuring out if an IP is on LAN or INET
- Prev by Date: Re: Invoking apps within VB
- Next by Date: Re: I am trying to convert a C# file to VB.NET - need help
- Previous by thread: Develop your own Accounting software using Microsoft technologies
- Next by thread: Re: At a loss figuring out if an IP is on LAN or INET
- Index(es):
Relevant Pages
|