[DllImport("Wlanapi.dll", SetLastError = true)]
public static extern uint WlanGetAvailableNetworkList(IntPtr hClientHandle, ref Guid pInterfaceGuid, uint dwFlags, IntPtr pReserved, ref IntPtr ppAvailableNetworkList);
<DllImport("Wlanapi.dll", SetLastError:=True)>
Public Shared Function WlanGetAvailableNetworkList(ByVal hClientHandle As IntPtr, ByRef pInterfaceGuid As Guid, ByVal dwFlags As UInteger, ByVal pReserved As IntPtr, ByRef ppAvailableNetworkList As IntPtr) As UInteger
End Function
private const uint WLAN_AVAILABLE_NETWORK_INCLUDE_ALL_ADHOC_PROFILES = 0x00000001;
private const uint WLAN_AVAILABLE_NETWORK_INCLUDE_ALL_MANUAL_HIDDEN_PROFILES = 0x00000002;
Do you know one? Please contribute it!
None.
Please add some!
C#
IntPtr ppAvailableNetworkList = new IntPtr();
Guid pInterfaceGuid = ((WLAN_INTERFACE_INFO)wlanInterfaceInfoList.InterfaceInfo[0]).InterfaceGuid;
WlanGetAvailableNetworkList(ClientHandle, ref pInterfaceGuid, WLAN_AVAILABLE_NETWORK_INCLUDE_ALL_MANUAL_HIDDEN_PROFILES, new IntPtr(), ref ppAvailableNetworkList);
WLAN_AVAILABLE_NETWORK_LIST wlanAvailableNetworkList = new WLAN_AVAILABLE_NETWORK_LIST(ppAvailableNetworkList);
WlanFreeMemory(ppAvailableNetworkList);
for (int j = 0; j < wlanAvailableNetworkList .dwNumberOfItems; j++)
{
Interop.WLAN_AVAILABLE_NETWORK network = wlanAvailableNetworkList.wlanAvailableNetwork[j];
Console.WriteLine("Available Network: ");
Console.WriteLine("SSID: " + network.dot11Ssid.ucSSID);
Console.WriteLine("Encrypted: " + network.bSecurityEnabled);
Console.WriteLine("Signal Strength: " + network.wlanSignalQuality);
Console.WriteLine("Default Authentication: " +
network.dot11DefaultAuthAlgorithm.ToString());
Console.WriteLine("Default Cipher: " + network.dot11DefaultCipherAlgorithm.ToString());
Console.WriteLine();
}