开发者

How can I enumerate all available wireless networks and display them in a ListBox? [closed]

开发者 https://www.devze.com 2023-03-22 05:48 出处:网络
开发者_开发技巧 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its current form
开发者_开发技巧 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago.

I have a problem regarding with C#. How to populate a listbox with those wireless networks which are found by the computer in C#?


You need to call the WlanGetAvailableNetworkList function.

This fills in a WLAN_AVAILABLE_NETWORK_LIST structure 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.


Use the Managed Wifi API which just wraps the Native Wifi Api. It's pretty easy to use to get the list of SSIDs. The method you want is

WlanInterface.GetAvailableNetworkList

which just wraps WlanGetAvailableNetworkList.

From there you can put these into a ListBox.

0

精彩评论

暂无评论...
验证码 换一张
取 消