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

C# – 如何访问WLAN信号强度等?

许多科学家已经发表了 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);
        }

        }
    }  
}

我希望这将是有益的享受

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

相关推荐