Click here to Skip to main content
15,884,473 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
Hi,

I am stuck at a place.. is their any way that I can get list of all the available internet connections on the users system...?

In simple words: I need list of all available ISP(available on his system) to show the user to connect one.

E.g.: User has two ISP connections installed
1. "AOL" and
2. "AT&T Internet Services"
Now user will select any one connection i have to connect to that selected ISP.

-With Regards,
AJ
Posted
Updated 29-Mar-12 21:19pm
v2

1 solution

I assume you're looking for the list of network interfaces. It is possible through System.Net.NetworkInformation.NetworkInterface class, specifically the GetAllNetworkInterfaces() method. Here is the sample code

C#
public static void DisplayDnsConfiguration()
{
    NetworkInterface[] adapters = NetworkInterface.GetAllNetworkInterfaces();
    foreach (NetworkInterface adapter in adapters)
    {
        IPInterfaceProperties properties = adapter.GetIPProperties();
        Console.WriteLine(adapter.Description);
        Console.WriteLine("  DNS suffix .............................. : {0}",
            properties.DnsSuffix);
        Console.WriteLine("  DNS enabled ............................. : {0}",
            properties.IsDnsEnabled);
        Console.WriteLine("  Dynamically configured DNS .............. : {0}",
            properties.IsDynamicDnsEnabled);
    }
    Console.WriteLine();
}
 
Share this answer
 
Comments
AJV King 30-Mar-12 3:18am    
Not exactly this..!!
e.g. User has two ISP connections installed "AOL" and "AT&T Internet Services"; now user will select any one connection i have to connect to that selected ISP.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900