许多科学家已经发布papers记录了通过测量其信号强度,到达时间,往返时间等信息来跟踪通过WLAN连接的设备。任何想法如何使用任何.NET API访问Windows中的这些值?C# - 如何访问WLAN信号强度和其他?
或者您是否知道可用于位置跟踪的软件SDK?
许多科学家已经发布papers记录了通过测量其信号强度,到达时间,往返时间等信息来跟踪通过WLAN连接的设备。任何想法如何使用任何.NET API访问Windows中的这些值?C# - 如何访问WLAN信号强度和其他?
或者您是否知道可用于位置跟踪的软件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);
}
}
}
}
我希望这将是有益的享受
Windows本身现在提供Location API。
好主意,但没有提及无线局域网跟踪,他们假设我们有GPS设备...慢和不准确。 – 2009-11-06 10:41:13
位置API由“默认”技术无关,意味着它可以从任何类型的位置源获得输入。如果你想使用WLAN,只需要为Windows编写一个源驱动程序。 这将允许所有具有Location API能力的应用程序使用您的源代码,同样,您的应用程序可以使用多个源代码。但是,您会发现,对于室内定位而言,WLAN并非最佳可用解决方案。 – andy 2009-11-23 08:42:42
Managed Wifi API将提供信号强度信息。下面是摘自我先前提出并回答了here问题的代码片段:
static void Main(string[] args)
{
WlanClient client = new WlanClient();
foreach (WlanClient.WlanInterface wlanIface in client.Interfaces)
{
Wlan.WlanAvailableNetwork[] networks = wlanIface.GetAvailableNetworkList(0);
foreach (Wlan.WlanAvailableNetwork network in networks)
{
Console.WriteLine("Found network with SSID {0} and Siqnal Quality {1}.", GetStringForSSID(network.dot11Ssid), network.wlanSignalQuality);
}
}
}
static string GetStringForSSID(Wlan.Dot11Ssid ssid)
{
return Encoding.ASCII.GetString(ssid.SSID, 0, (int) ssid.SSIDLength);
}
+1这是一个很好的答案。非常清楚! – 2010-03-02 03:11:46
嗨科迪,你能否扩展这个例子来连接一个可用的wifi ssids? – 2011-07-07 20:51:22
这个答案应该提到nativewifi命名空间可以在这里找到http://managedwifi.codeplex.com/ – Joe 2015-04-20 16:30:16
是否有可能找到像802.11n,802.11g的Wifi模式? – 2017-11-21 06:41:22