Try changing the code from...
to...Code:For Each queryObj As ManagementObject in searcher.Get() Console.WriteLine("-----------------------------------") Console.WriteLine("Win32_NetworkAdapterConfiguration instance") Console.WriteLine("-----------------------------------") If queryObj("IPAddress") Is Nothing Then Console.WriteLine("IPAddress: {0}", queryObj("IPAddress")) Else Dim arrIPAddress As String() arrIPAddress = queryObj("IPAddress") For Each arrValue As String In arrIPAddress Console.WriteLine("IPAddress: {0}", arrValue) Next End If Next
Code:For Each queryObj As ManagementObject in searcher.Get() If Not(queryObj("IPAddress") Is Nothing) Then Dim arrIPAddress As String() arrIPAddress = queryObj("IPAddress") For Each arrValue As String In arrIPAddress Console.WriteLine(arrValue) Next End If Next




Reply With Quote