微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

获得无线信号强度

有没有办法获得C#中的无线信号强度? 目前我正在通过

Process proc = new Process(); proc.StartInfo.CreateNowindow = true; proc.StartInfo.FileName = "netsh"; proc.StartInfo.Arguments = "wlan show interfaces"; proc.StartInfo.RedirectStandardOutput = true; proc.StartInfo.UseShellExecute = false; proc.Start();

然后通过读取输出来获得无线信号强度。 有没有更好的办法? 最好使用API

Windows实用程序可以从文件放置中打印和存档

如何从C ++中的其他目录运行命令行工具

区分大小写的主机卷装入Docker for Windows

为什么ruby从RubyInstaller安装没有finddll的放置在gem / lib文件夹中?

为什么我无法使用C#检测蓝牙Estimote信标,但Windows操作系统可以find它们?

为什么不使用WMI查询来以干净的方式获取

private double RetrieveSignalString() { double theSignalStrength = 0; Connectionoptions theConnectionoptions = new Connectionoptions(); ManagementScope theManagementScope = new ManagementScope("root\wmi"); ObjectQuery theObjectQuery = new ObjectQuery("SELECT * FROM MSNdis_80211_ReceivedSignalStrength WHERE active=true"); ManagementObjectSearcher theQuery = new ManagementObjectSearcher(theManagementScope,theObjectQuery); try { //ManagementObjectCollection theResults = theQuery.Get(); foreach(ManagementObject currentObject in theQuery.Get()) { theSignalStrength = theSignalStrength + Convert.Todouble(currentObject["Ndis80211ReceivedSignalStrength"]); } } catch (Exception e) { //handle } return Convert.Todouble(theSignalStrength); }

请参阅此了解更多信息。 http://social.msdn.microsoft.com/Forums/en-US/34a66ee5-34f8-473d-b6f2-830a14e2300b/get-signal-strength-in-c

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐