许多科学家发表了papers文件,记录了如何通过测量WLAN的信号强度,到达时间,往返时间等来跟踪通过WLAN连接的设备。您知道如何使用任何.NET API在Windows中访问这些值吗?

还是您知道已经可以用于位置跟踪的软件SDK?

最佳答案

您好,对于Windows 7,这是一个很好的代码,它可以检测到所有具有MAC地址RSSI SSID的AP:

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);
        }

        }
    }
}

希望对您有所帮助

关于C#-如何访问WLAN信号强度及其他?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/1686715/

10-09 07:35