0

OK..Lets see if I can make this question make any sense :/

I have made a query that allows me to see NetworkAdapter class information for a selected NIC. I somehow want to include information from the NetworkAdapterConfiguration class in the same query (IPAddress, DefaultGateway etc). PLEEEEEEES HELP!!

intquery = new ManagementObjectSearcher("SELECT * FROM Win32_NetworkAdapter WHERE Description ='" + comboBox1.Items[comboBox1.SelectedIndex].ToString()+ "'");
        ManagementObjectCollection queryCollection = intquery.Get();
        queryCollection = intquery.Get();

This is the other query for tcp/ip info

ManagementObjectSearcher query = new ManagementObjectSearcher("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = 'TRUE'");
        ManagementObjectCollection queryCollection1 = query.Get();

Can i merge them to select from the same combo box??

Many Thanks :)

Dylan Jackson
  • 801
  • 1
  • 17
  • 33

1 Answers1

1

You can use the Win32_NetworkAdapterSetting WMI class which is an association class that represents the relationship between the Win32_NetworkAdapterConfiguration and Win32_NetworkAdapter classes. check this How to join in a WMI Query (WQL) to see how the Associations class works (the link show another WMI classes, but you can figure out how use it in your case)

Community
  • 1
  • 1
RRUZ
  • 134,889
  • 20
  • 356
  • 483