problem with managmentobject properties changing

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
 
P

palouf

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

Thats'all ..;
ci@o
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top