Groups | Blog | Home
all groups > dotnet sdk > march 2006 >

dotnet sdk : Problem with wmi method


Romain Laffitte
3/28/2006 4:26:02 AM
Hi,
i hope i post this mail in the good forum(it's the first time i do)

I want to change the IP of my computer by using WMI I work on VS2005.

To do that I use enableStatic() method of the object
win32_NetworkadapterConfiguration.

With the code :

public static void SwitchToStatic(string idInterface, string
adresseIP, string masque, string passerelle, string dns)
{
NetworkAdapterConfiguration netConf = new
NetworkAdapterConfiguration(Convert.ToUInt32(idInterface));
netConf.EnableStatic(new string[] { adresseIP }, new string[] {
masque }).ToString();
}

The class NetworkAdapterConfiguration is generated by the command :
MgmtClassGen.exe win32_NetworkAdapterConfiguration /l cs

My problem is when i call my method nothing happen, do you no what is the
problem.

Sorry for my english i'm french ^^.

Romain Laffitte
3/28/2006 9:58:49 PM
Hi,

if nobody know how to solve my problem, do you know where I can find Idea
to help me ?

Thanks

Romain

[quoted text, click to view]

Phil Wilson
4/6/2006 4:14:44 PM
The EnableStatic method is documented to return a uint32 that is usually an
error. For example, 70 = invalid IP address.
--
Phil Wilson [MVP Windows Installer]
----
"Romain Laffitte" <RomainLaffitte@discussions.microsoft.com> wrote in
message news:25E3596E-D971-45F2-BE7E-554584DBFAC6@microsoft.com...
[quoted text, click to view]

AddThis Social Bookmark Button