C# - 我如何可以访问无线网络的信号强度和其他人呢? [英] C# - How do I access the WLAN signal strength and others?

查看:311
本文介绍了C# - 我如何可以访问无线网络的信号强度和其他人呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

许多科学家已经发表的论文记录设备通过连接方式WLAN可以通过测量它的信号强度,到达时间,往返时间等任何想法如何,我可以在Windows中使用任何.NET API访问这些值?

Many scientists have published papers documenting how devices connected via WLAN can be tracked by measuring its Signal Strength, Time Of Arrival, Round Trip Time, etc. Any idea how I can access these values in Windows using any .NET API?

或者你知道已经可以用于定位跟踪软件的SDK?

Or do you know of software SDKs already available for location tracking?

推荐答案

您好:对于Windows 7,这是一个好的代码至极可以检测所有AP与MAC地址RSSI SSID:

hello for WIndows 7 this is a good code wich can detect all AP with MAC adress 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);
        }

        }
    }  
}

我希望这将是有益的享受。

i hope it will be helpful enjoy

这篇关于C# - 我如何可以访问无线网络的信号强度和其他人呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆