problem with managmentobject properties changing

  • Thread starter Thread starter palouf
  • Start date Start date
P

palouf

Hi to all,
i try to modify my network params dynamically. I can't manage to do it.
does smbdy knows what i'm doing wrong ?

string[] temp = new string[1];
ManagementObjectSearcher ms = new
ManagementObjectSearcher("SELECT * FROM
Win32_NetworkAdapterConfiguration");
ManagementObjectCollection moc = ms.Get();
foreach(ManagementObject mo in moc)
{

if((string)mo.GetPropertyValue("Description") ==
this.interface)
{
temp[0] = node["ip"].InnerText;
mo.SetPropertyValue("IPAddress",temp);
}
}

and there nothing happened .... no exception raised but no updates of the
netparams has been done
my objective is to change the ip address and the subnetwork mask


Thanks for your help.

Palouf
 
So i found a way to change the ip adresses withiout the managment objects :
using Netsh command

Thats'all ..;
ci@o
 
Back
Top