mardi 31 mars 2015

How to get dns name using Wmi

Hi I have a combobax control and populating it using this Wmi query.



ManagementObjectSearcher o = new ManagementObjectSearcher("select * from Win32_NetworkAdapter where PhysicalAdapter=true");
foreach (var v in o.Get())
{
cmbAdapters.Items.Add(v["Name"].ToString());
}


I am wondering how can I get Dns Server name or mybe SubnetMask information about a specificic adapter depends on selection from combobax .I think Win32_NetworkAdapterConfigurationclass is the right class for doing this but I have no idea how to do


Aucun commentaire:

Enregistrer un commentaire