Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Could it be that you are inputting <a href="http://en.wikipedia.org/wiki/IPv6" rel="nofollow">IPv6</a> addresses as well? Just playing around with PowerShell it seems not to like them. Perhaps you can post actual values that are being inputted whilst debugging, it would help a lot. Also maybe try statically inputting some values like:</p> <pre><code>new string[]{"192.168.0.1"}, new string[] {"255.255.255.255"} </code></pre> <p>Also unless you really, really need C# and a GUI you may want to consider using PowerShell (requirement is it being installed of course) as WMI is really much simpler to manipulate there (sadly you still have that learning curve though).</p> <p>This is just an example of how to use PowerShell, you can at the very least use it for some testing:</p> <pre><code>Get-WmiObject Win32_NetworkAdapterConfiguration </code></pre> <p>Then get the index of your adapter then run, but replace your index number:</p> <pre><code>$obj = Get-WmiObject Win32_NetworkAdapterConfiguration | where {$_.Index -eq 1} $obj.EnableStatic("192.168.0.1", "255.255.255.0") </code></pre> <p>To get method parameters just run:</p> <pre><code>$obj.EnableStatic </code></pre> <p>It will return:</p> <pre><code>MemberType : Method OverloadDefinitions : {System.Management.ManagementBaseObject EnableStatic(System.String[]IPAddress, System.String[] SubnetMask)} TypeNameOfValue : System.Management.Automation.PSMethod Value : System.Management.ManagementBaseObject EnableStatic(System.String[]IPAddress, System.String[] SubnetMask) Name : EnableStatic IsInstance : True </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload