Click here to Skip to main content
15,881,172 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi

please I try to find all available wifi connection name using c# code
in my windows application ?
to display it to user ?


please any help ?



thanks :)
Posted
Updated 9-May-18 22:54pm

 
Share this answer
 
Comments
[no name] 19-Sep-15 13:53pm    
Good link (2'nd), my 5.
Abhinav S 19-Sep-15 14:09pm    
Thanks.
Wendelius 19-Sep-15 14:03pm    
Good link, 5!

Good to keep in mind that in order to see the name of the WiFi network, it needs to broadcast the name :)
Abhinav S 19-Sep-15 14:09pm    
Thanks.
private static void GetAvailableWifi()
        {
            WlanClient client = new WlanClient();
            foreach (WlanClient.WlanInterface wlanIface in client.Interfaces)
            {
                // Lists all networks with WEP security
                Wlan.WlanAvailableNetwork[] networks = wlanIface.GetAvailableNetworkList(0);
                foreach (Wlan.WlanAvailableNetwork network in networks)
                {
                    Wlan.Dot11Ssid ssid = network.dot11Ssid;
                    string networkname = Encoding.ASCII.GetString(ssid.SSID, 0, (int)ssid.SSIDLength);
                    if (networkname != "")
                    {
                        networkList.Add(networkname.ToString());
                    }
                }
            }

            if(networkList.Count > 0)
            {
                Console.WriteLine("Listing the available wifi");
                Console.WriteLine("--------------------------");

                foreach(var item in networkList)
                {
                    Console.WriteLine(item.ToString());
                }
            }
        }
 
Share this answer
 

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