Solved

Get subnet mask for local computer ?

Posted on 2001-08-08
3
756 Views
Last Modified: 2013-12-03
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
0
Comment
Question by:mjsmith99
3 Comments
 
LVL 32

Expert Comment

by:jhance
ID: 6368617
See:

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

The technique described here will get you both your IP and netmask.
0
 
LVL 15

Accepted Solution

by:
NickRepin earned 100 total points
ID: 6375106
0
 
LVL 1

Author Comment

by:mjsmith99
ID: 6383076
I awarded the points to Nick because of his excellent source code.  jhance's answer was also useful.

Thanks,
Mike
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to make a Windows 7 gadget that accepts files dropped from the Windows Explorer.  It also illustrates how to give your gadget a non-rectangular shape and how to add some nifty visual effects to text displayed in a your gadget.…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question