Namespace Crossroads
<p>I'm a novice coder so I'm not that knowledgeable.  Please be kind with my silly questions.
I am writing an IP address switching utility</p>

<p>I've got two VB.NET functions:
GetNIC()  and  MakeStatic()</p>

<p>GetNIC() uses the System.Net.NetworkInformation namespace.  I have it running to find the current IPv4 adapter, IP, DGW, SM and other info.</p>

<p>MakeStatic() uses the System.Management namespace.  I am trying to figure out how to use the info from GetNIC() to single out the same adapter and change the info.  Here is a snippet of my code to switch the IP.  I never really have used ManagementBaseObjects before and was wondering how to find the GUID (or something) that matches the GUID I have already found in GetNIC().</p>

<pre><code>            Dim objNewIP As ManagementBaseObject = Nothing
            Dim objSetIP As ManagementBaseObject = Nothing
            Dim objNewGate As ManagementBaseObject = Nothing

            objNewIP = objMO.GetMethodParameters("EnableStatic")
            objNewGate = objMO.GetMethodParameters("SetGateways")

            'Set DefaultGateway
            objNewGate("DefaultIPGateway") = New String() {Gateway}
            objNewGate("GatewayCostMetric") = New Integer() {1}

            'Set IPAddress and Subnet Mask
            objNewIP("IPAddress") = New String() {IPAddress}
            objNewIP("SubnetMask") = New String() {SubnetMask}

            objSetIP = objMO.InvokeMethod("EnableStatic", objNewIP, Nothing)
            objSetIP = objMO.InvokeMethod("SetGateways", objNewGate, Nothing)
</code></pre>

<p>Basically I'm shooting for:</p>

<pre><code>If objMO.&lt;&lt;something&gt;&gt; = NICguid then
   &lt;&lt;&lt;Do the above code&gt;&gt;
End IF
</code></pre>