Bonjour à tous,
j'ai essayé de modifier la valeur enableDHCP avec WMI avec le code suivant :
Dim Ms As New ManagementScope("\root\cimv2")
Dim requete As New ObjectQuery("select * from win32_networkadapterconfiguration where index= 1")
Dim recherche As New ManagementObjectSearcher(Ms, requete)
Ms.Connect()
Dim Col As ManagementObjectCollection = recherche.Get
For Each obj As ManagementObject In Col
ObjSetDHCP = obj.GetMethodParameters("EnableDhcp")
obj.InvokeMethod("EnableDhcp", Nothing)
Exit For
Next
Bon ca marche très bien mais une chose très etrange : si je debranche le cable reseau, plus moyen d'activer le dhcp par ce code jusqu'à ce que je le rebranche !!!
Est-ce normal ????