public void EnableDHCP()
{
string ethernetDescription = "{5F632379-D5A7-4F26-89FC-C172212EDF65}";
ManagementClass wmi = new ManagementClass("Win32_NetworkAdapterConfiguration");
ManagementObjectCollection moc = wmi.GetInstances();
foreach (ManagementObject mo in moc)
{
//如果没有启用IP设置的网络设备则跳过
/* if (!(bool)mo["IPEnabled"])
continue;*/
string settingID = mo["SettingID"].ToString();
......................
阅读全部 | 2022年12月1日 16:40