0

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 "192.168.1.1"

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 :)

3 Answers 3

1

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

3
  • thanks for the info, but this just shows the details for my local/client wireless 802.11n wifi card on my computer, this doesn't list or show the actual router, which would be the linksys, i checked through the enumeration.
    – user55887
    Oct 1, 2010 at 20:11
  • Try one of the other WMI classes then. You can still use the code to run through the enumeration Oct 1, 2010 at 23:14
  • which WMI class do you think it is likely to be? i'm at a stumbling block!
    – user55887
    Oct 13, 2010 at 1:36
0

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

1
  • hi dbasnett, i'm trying to get the name of the router that is tied to the particular default gateway/router ip as is shown through the method described above, do you know how to do this? thanks.
    – user55887
    Oct 13, 2010 at 1:38
0

I got the answer from a superuser post and here is the link... https://superuser.com/questions/194862/how-to-get-router-name-ip-as-shown-in-windows-network-tab-in-code-or-from-reg

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .