检测连接到无线网络的手机 - C# [英] Detect the cell phone connected to wireless network - C#

查看:162
本文介绍了检测连接到无线网络的手机 - C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在C#编程,我想检测无线网络(Wi-Fi)中的手机(名称,IP地址,RSSI,...),以计算之后,我的电脑和手机之间的距离
实际上,我能够使用System.DirectoryServices检测连接到同一网络的计算机名称:

I'm programming in C# and i want to detect a cell phone(Name, IP address, RSSI, ...) in Wireless Network (Wi-Fi) to calculate after that the distance between my computer and the cell phone Actually, I'm able to detect computers name connected to the same network with :

using System.DirectoryServices;
...

List<String> _ComputerNames = new List<String>();
String _ComputerSchema = "Computer";
DirectoryEntry _WinNTDirectoryEntries = new DirectoryEntry("WinNT:");
foreach (DirectoryEntry _AvailDomains in _WinNTDirectoryEntries.Children)
{
    foreach (DirectoryEntry _PCNameEntry in _AvailDomains.Children)
    {
        if (_PCNameEntry.SchemaClassName.ToLower().Contains(_ComputerSchema.ToLower()))
        {
            _ComputerNames.Add(_PCNameEntry.Name);
        }
    }
}

但我找不到我的单元格电话连接到同一个Wi-Fi网络。

But I cannot find my cell phone that is connect to the same wi-fi network.

我如何解决这个问题?
谢谢!

How can I resolve this problem ? Thanks!

推荐答案

我不认为ActiveDirectory会在这里工作太好,你可能需要以更密切地与接入点本身工作以获取RSSI值。除非有一个特定的领域知识,你有关于所有手机是ActiveDirectory的一部分,像Jean说:你只能获得MAC地址,可能的IP地址和RSSI值。

I dont think ActiveDirectory is going to work too well for you here, your likely going to need to work more closely with the access point itself to fetch the RSSI values. Unless there is a particular domain knowledge you have about all phones being part of an ActiveDirectory its like Jean said: you only get MAC address, possibly IP address and the RSSI value.

如果您只对距离感兴趣,您可能需要使用特定设备测试一系列距离,并使用RSSI距离列表来满足距离基于RSSI值的新设备。

If you are only interested in distance you will likely need to test out a range of distances with a particular device and use the RSSI-distance list you to guestimate the distance of a new device based on the RSSI value for it.

您会遇到的问题是,您可能有一个设备的X RSSI值,另一个设备的2 RSSI值,他们可以很好地是完全相同的距离。虽然如果你只对手机感兴趣,我期望波动不那么严重。

A problem you will encounter is you might have X RSSI Value for one device, and 2X RSSI Value for another device and they could very well be the exact same distance. Although if you are only interested in phones I would expect the fluctuation to be less severe.

一个更准确的方法是多个接入点设置和三角测量该设备的位置有一点数学,这个的正面也给你距离和方向,相当于位置

A more accurate way to do this would be to have multiple Access Points setup and triangulate the device's position with a bit of math, the plus side of this is also giving you distance as well as direction, amounting to location

这篇关于检测连接到无线网络的手机 - C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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