I want to programmatically select a network card connected to the Internet. I need this to control how much traffic goes through the map. This is what I use to get instance names
var category = new PerformanceCounterCategory("Network Interface"); String[] instancenames = category.GetInstanceNames();
And this is how instancenames looks at my car
[0] "6TO4 Adapter" [1] "Internal" [2] "isatap.{385049D5-5293-4E76-A072-9F7A15561418}" [3] "Marvell Yukon 88E8056 PCI-E Gigabit Ethernet Controller" [4] "isatap.{0CB9C3D2-0989-403A-B773-969229ED5074}" [5] "Local Area Connection - Virtual Network" [6] "Teredo Tunneling Pseudo-Interface"
I want the solution to be reliable and work on other PCs, I would also prefer .NET. I found other solutions, but they seem more complicated for the purposes.
Is there anything else?
Thanks!
EDIT
Before voting, in order to close this question, please read it first and make sure that I have already mentioned some of the available solutions. I ask if there is anything else simpler and more reliable (i.e. NOT C ++, WMI, or parsing the output of a console application)
source share