C# – 如何访问WLAN信号强度等?
发布时间:2020-12-15 06:52:09 所属栏目:百科 来源:网络整理
导读:许多科学家已经发表了 papers,记录了如何通过测量其信号强度,到达时间,往返时间等来跟踪通过WLAN连接的设备.任何想法如何使用任何.NET API在Windows中访问这些值? 或者您是否知道可用于位置跟踪的软件SDK? 解决方法 你好WIndows 7这是一个很好的代码,可以
许多科学家已经发表了
papers,记录了如何通过测量其信号强度,到达时间,往返时间等来跟踪通过WLAN连接的设备.任何想法如何使用任何.NET API在Windows中访问这些值?
或者您是否知道可用于位置跟踪的软件SDK? 解决方法
你好WIndows 7这是一个很好的代码,可以检测所有的AP与MAC地址RSSI SSID:
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using NativeWifi; class Program { static void Main(string[] args) { WlanClient client = new WlanClient(); // Wlan = new WlanClient(); try { foreach (WlanClient.WlanInterface wlanIface in client.Interfaces) { Wlan.WlanBssEntry[] wlanBssEntries = wlanIface.GetNetworkBssList(); foreach (Wlan.WlanBssEntry network in wlanBssEntries) { int rss = network.rssi; // MessageBox.Show(rss.ToString()); byte[] macAddr = network.dot11Bssid; string tMac = ""; for (int i = 0; i < macAddr.Length; i++) { tMac += macAddr[i].ToString("x2").PadLeft(2,'0').ToUpper(); } Console.WriteLine("Found network with SSID {0}.",System.Text.ASCIIEncoding.ASCII.GetString(network.dot11Ssid.SSID).ToString()); Console.WriteLine("Signal: {0}%.",network.linkQuality); Console.WriteLine("BSS Type: {0}.",network.dot11BssType); Console.WriteLine("MAC: {0}.",tMac); Console.WriteLine("RSSID:{0}",rss.ToString()); } Console.ReadLine(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } } } } 我希望这将是有益的享受 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- mongodb内置角色及赋权管理
- PostgreSQL学习手册(索引)
- 未指定Content-Type: application/x-www-form-urlencoded将
- react-native – React Native:嵌套在文本节点下的意外视图
- properties文件,xml占位符总结
- 值传递和地址传递,C语言函数传参方式详解
- plupload ie9 上传没大小 和 不支持 flash
- ruby-on-rails – ActionDispatch :: Http :: UploadedFile
- cocos2d-js 在线更新代码脚本 动态更新脚本程序 热更新 绕过
- 将心率测量服务添加到iPhone作为外围设备