I have a problem regarding with C#. How to populate a listbox with those wireless networks which are found by the computer in C#?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You need to call the
WlanGetAvailableNetworkListfunction.This fills in a
WLAN_AVAILABLE_NETWORK_LISTstructure with information about all of the wireless networks that are available on the specified interface.Once you have that, it’s a simple matter of iterating through the array and adding each wireless network to your ListBox control.
This API is available as of Windows XP SP3, and is redistributable for clients running XP SP2 using the Wireless LAN API.
And rather than writing the P/Invoke definitions yourself, you could investigate the Managed Wifi API, which is a .NET class library that wraps most of these native functions for you already.