tags:

views:

439

answers:

1

how to get network connection list in my computer with c# vpn list or other

in windows 7 this path Control Panel\Network and Internet\Network Connections

i need for write a function to connect to internet in c#

+1  A: 

I assume you're looking for the list of network interfaces.

The System.Net.NetworkInformation.NetworkInterface class is probably what you are after, specifically the GetAllNetworkInterfaces() method.

To get the same list as Control Panel, I suspect you will also need to filter on the NetworkInterfaceType property value, to skip loopback and tunneling interfaces.

Leon Breedt
i need to get active and deactivate connection list but in you answer only active connection showed
jozi
I don't believe you can do this using the .NET APIs, you will probably need to use P/Invoke.If you need this for programmatically enabling/disabling a particular interface, there is this existing question: http://stackoverflow.com/questions/860673/programatically-disable-enable-network-interface
Leon Breedt
no this link for disable card but i looking for connect to internet
jozi