Solved

How to get Gateway, DNS server address/name

Posted on 2000-04-18
1
391 Views
Last Modified: 2010-04-10
is there any api to get the gateway, dns server address/name..?

any idea about the location in registry where it is located..

sanesh@hclt.com
0
Comment
Question by:sanesh
1 Comment
 
LVL 1

Accepted Solution

by:
yanissim earned 100 total points
Comment Utility
if you are using Win2k you can use
the IP helper library,
On nt4 you can extarct the info from the registry,
every installed adapter which is bind to
TCP/ip has a TCP/IP key where all the info you need is stored - including IP address,mask,gateway,etc..

lets say you have one network adapter
under HKLM/software/Microsoft/Windows Nt/Current version/Network cards/1
check the servicename value - this is the name of the base driver instance -
E100b1 for Intel 10/100 adapter.
then, go to HKLM/System/CurrentControlSet/Services/E100B1/TCPIP/Parameters and you will see everything you want
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

763 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

6 Experts available now in Live!

Get 1:1 Help Now