English 中文(简体)
如何扫描网络上存在的无线设备
原标题:How to scan the wireless devices which exist on the network

现在我的团队正在使用Windows应用程序C#开展网络项目工作。

How to scan the wireless devices which exist on the network.The functionality is exactly the same thing that you see in the existing windows utilities within the windows operating system. I m sure you experienced when you plug a wireless laptop card in, it brings up a window that shows you all of the access points it detects for connecting to. How to capture this information listed below

  • MAC Address
  • IP Address
  • SSID
  • Channel
  • Timestamp
  • Cipher type
  • Encryption level
  • Signal Strength

Did i use Kismet or NetStumbler. Please suggest good library/code

最佳回答

如果您准备好投资,那么您可以使用WiFi-Manager/高级WiFi-Manager

WiFi-Manager是一种开发工具,允许您使用一组API函数在Windows XP SP2和Windows Vista中管理WiFi连接和设置,尽管这些Windows版本使用绝对不同的API来进行无线网络管理。另外,WiFi-Manager为所有API函数提供了一个COM接口,因此您可以简单地从VB或诸如VB.NET或C#等.NET语言控制WiFi设置。

WiFi-Manager包含用于枚举WiFi适配器、枚举可用网络并获取其设置、连接和断开网络的功能、与无线网络配置文件一起工作的功能等。

高级WiFi管理器是一种下一代工具,它支持WiFi管理器的所有功能,还可以使用NDIS来管理WiFi适配器,并在Windows 2000/2003/XP/Vista/Windows7中工作,不依赖于已安装的服务包或热补丁!

我希望这个有用。

问题回答

你可以使用Managed Wifi API。它只是原生Wifi Api的一个包装器,可用于Windows XP及更高版本。

这个代码应该显示可用的网络:

WlanClient client = new WlanClient();
foreach ( WlanClient.WlanInterface wlanIface in client.Interfaces )
{
    // Lists all available networks
    Wlan.WlanAvailableNetwork[] networks = wlanIface.GetAvailableNetworkList( 0 );
    foreach ( Wlan.WlanAvailableNetwork network in networks )
    {                     
        Console.WriteLine( "Found network with SSID {0}.", GetStringForSSID(network.dot11Ssid));
    }
}

static string GetStringForSSID(Wlan.Dot11Ssid ssid)
{
    return Encoding.ASCII.GetString( ssid.SSID, 0, (int) ssid.SSIDLength );
}

你应该使用本机WiFi API。首先需要使用一组功能。

  • openhandler()
  • getEnuminterface() - here you will get GUID of your WiFi hardware
  • wlanscann()
  • wlangetavailablenetworklist() -here as output you will get a structure where you can find all above information.
  • closehandler()

只需深入本地 WiFi,即可获得所有信息。

从Windows 8.1和Windows Server 2012 R2开始,请改用Wi-Fi Direct。

您可以从这里开始:“如何编程检测Wi-Fi路由器和信号强度?





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签