How to get Router Name & IP as shown in Windows Network Tab? (in Code or from Registry)

Posted on

How to get Router Name & IP as shown in Windows Network Tab? (in Code or from Registry) – Managing your servers can streamline the performance of your team by allowing them to complete complex tasks faster. Plus, it can enable them to detect problems early on before they get out of hand and compromise your business. As a result, the risk of experiencing operational setbacks is drastically lower.

But the only way to make the most of your server management is to perform it correctly. And to help you do so, this article will share nine tips on improving your server management and fix some problem about windows, windows-server-2008, windows-server-2003, router, ip.

Basically, if you go to Start and click Computer and then click on the Network link on the left hand side, you’ll notice on the right hand side several categories, one of which is titled “Network Infrustructure”, in that category, my router is listed, and in my case, it is “LINKSYS WAG160N Wireless-N ADSL2+ Gateway” and when you right-click and select properties, it lists basic info such as internal/gateway IP address, on mine it is “”

I would like to know how to retreive this information in ie: either registry location or Windows API call or .net framework reference etc, preferably a Windows API or Registry Location so that i can call it using a legacy VB6 app but anything will do at the moment as i am totally lost in this respect.

thanks guys 🙂

Solution :

You could easily get all the information you need using WMI Network classes.
For a simple .Net code with a full implementation, look here.

Did you ask this at SO? You can parse the output of the “route print -4” to get the default gateway.

I got the answer from a superuser post and here is the link…

basically, turns out you need to look into the upnp.dll insite windowssystem32 and learn how to use it by looking up references for the upnp api on msdn! this is how you get the details.

Leave a Reply

Your email address will not be published. Required fields are marked *