Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Get subnet mask for local computer ?

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

If you have ever found yourself doing a repetitive action with the mouse and keyboard, and if you have even a little programming experience, there is a good chance that you can use a text editor to whip together a sort of macro to automate the proce…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

829 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