On the codeplex there is something similar, but there is no getting the mac address of the device. How can I get the entire list of names and mac addresses of routers (wifi points)?

  • Look here for a list of IP and MAC networks. Primus Singularis
  • There is such a protocol ARP, And it stores in the system correspondence tables of ip and mac addresses. There is an arp command to manipulate this information. So there must be some API functions - Sergey
  • There he shows all the IP's and poppy addresses connected to the wifi point (those are how many people are sitting on my wifi'e). And I need a list of wifi points near me, with a poppy address (bssid). (on the codeplex there is a name, a signal, a point encryption algorithm, but the poppy never found there) - Vladimir Saleev

1 answer 1

The BSSID (as well as the signal level in dBm) can be obtained by calling the GetNetworkBssList method:

 // вывод MAC в виде ХХ:ХХ:ХХ:ХХ:ХХ:ХХ static string GetStringForBSSID(byte[] bssid) { var result = new StringBuilder(); result.Append(bssid[0].ToString("X2")); for (int i = 1; i < bssid.Length; ++i) { result.Append(":").Append(bssid[i].ToString("X2")); } return result.ToString(); } static string GetStringForSSID(Wlan.Dot11Ssid ssid) { return Encoding.ASCII.GetString(ssid.SSID, 0, (int)ssid.SSIDLength); } public static void Main(string[] args) { var client = new WlanClient(); if (client.Interfaces.Length < 1) throw new InvalidOperationException("Wireless adapter not found."); Console.WriteLine("SSID\t\t\tBSSID\t\t\tRSSI"); Console.WriteLine("-------------------------------------------------------"); WlanClient.WlanInterface nic = client.Interfaces[0]; foreach (Wlan.WlanAvailableNetwork network in nic.GetAvailableNetworkList(0)) { string ssid = GetStringForSSID(network.dot11Ssid); Wlan.WlanBssEntry[] bssList = nic.GetNetworkBssList( network.dot11Ssid, network.dot11BssType, network.securityEnabled); int rssi = 0; string bssid = ""; if (bssList.Length > 0) { rssi = bssList[0].rssi; bssid = GetStringForBSSID(bssList[0].dot11Bssid); } Console.WriteLine("{0,-16}\t{1,-8}\t{2} dBm", ssid, bssid, rssi); } }