Y quisiera saber como revertir esto
Código
string IPAddress = "192.168.1.101"; string SubnetMask = "255.255.255.0"; string Gateway = "192.168.1.254"; ManagementObjectCollection objMOC = objMC.GetInstances(); foreach (ManagementObject objMO in objMOC) { if (!(bool)objMO["IPEnabled"]) continue; try { ManagementBaseObject objNewIP = null; ManagementBaseObject objSetIP = null; ManagementBaseObject objNewGate = null; objNewIP = objMO.GetMethodParameters("EnableStatic"); objNewGate = objMO.GetMethodParameters("SetGateways"); objSetIP = objMO.InvokeMethod("EnableStatic", objNewIP, null); objSetIP = objMO.InvokeMethod("SetGateways", objNewGate, null); MessageBox.Show("Updated IPAddress, SubnetMask and Default Gateway!"); } catch (Exception ex) { MessageBox.Show("Unable to Set IP : " + ex.Message); }