Get subnet mask for local computer ?

Greetings from sunny Melbourne Australia,

I want to get the subnet mask associated with the local PC's address.

I understand how to use hostname() and gethostbyname() to get a list of one or more addresses for this PC but I need to know whether this PC is on the same network as another address - hence my need for the subnet mask.

Can anybody help ?

Thanks in Advance
mjsmith99@hotmail.youknowwhat
LVL 1
mjsmith99Asked:
Who is Participating?
 
jhanceCommented:
See:

http://www.caip.rutgers.edu/~arni/ws2/stas.htm

The technique described here will get you both your IP and netmask.
0
 
mjsmith99Author Commented:
I awarded the points to Nick because of his excellent source code.  jhance's answer was also useful.

Thanks,
Mike
0
All Courses

From novice to tech pro — start learning today.