Código C:
Ver original
private void DisableNetworkByAdapterType(string adapterType) { var query = new SelectQuery("Win32_NetworkAdapter", "NetConnectionStatus=2 and AdapterType='" + adapterType + "'"); var searcher = new ManagementObjectSearcher(query); foreach (ManagementObject result in searcher.Get()) { result.InvokeMethod("Disable", null); } }
Nota: el parámetro adapterType yo le mando "Ethernet 802.3"