Solved

Get subnet mask for local computer ?

Posted on 2001-08-08
3
753 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VBA Import all database objects 12 45
How to update List item Managed Metadata Column with JSOM 2 154
Trouble with References... 5 44
Why is "packages element is not declared"? 2 132
What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
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…

920 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now