Closed jampot5000 closed 6 years ago
Hi Jampot5000 let me take a look at it. I´m on it.
Ok. It is solved. The reflected name of the method was being captured incorrectly.
I´ll make some observations on your code:
1) foreach(var interface in interfaces)
You are using the reserved word interface
on your foreach statement. That won´t compile. I assume you put this on the example but you are using another name.
2) In my case I do not have a SetStatic
method. What I do have is a EnableStatic
one.
I´ve already pushed the corrected version. Let me know how it worked out.
Another observation is that you are using InterfaceIndex
as the key. It seems that the CIM_KEY for that class is Index
. I think that you´ll have to change that in order to make it work.
You can take a look at the doc right here: https://docs.microsoft.com/en-us/windows/desktop/CIMWin32Prov/win32-networkadapterconfiguration
When attempting to use WMIMethod.ExecuteMethod with parameters. The wrong method name is selected and the calling method name is used instead.
SetupInterface ends up being selected as the MethodName instead of SetStatic.