This project has moved. For the latest updates, please go here.

How To Get the List of Network Connections [Conditions Tab]

Topics: Examples
Aug 26, 2015 at 7:09 AM
I am trying to get the list of the Network Connections under the Conditions Tab.
However I am not able to find any object from the wrapper which allows me to retrieve the network connections list.

Any help will be appreciated
Aug 26, 2015 at 2:47 PM
The class used is not exposed publicly in the library. In the Source Code, look under the TaskEditor project, Native directory and find the NetworkProfile.cs class file. This is what you need. There is a static method on the class that retrieves the list of instances.
foreach (var item in Microsoft.Win32.NativeMethods.NetworkProfile.GetAllLocalProfiles())
   Console.WriteLine($"Network connection {item.Name} had an ID of {item.Id}");
Marked as answer by dahall on 9/1/2015 at 9:26 AM
Aug 27, 2015 at 11:21 AM
Thanks. Its working perfectly now.