6 个解决方案
#1
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
#include <windows.h>
#include<Wlanapi.h>
#pragma comment(lib, "wlanapi.lib")
int wmain()
{
HANDLE ClientHandle;DWORD nv,i,c;PWLAN_INTERFACE_INFO_LIST ilist;PWLAN_AVAILABLE_NETWORK_LIST nlist;static char ssid[36];
if(WlanOpenHandle(1,0,&nv,&ClientHandle)==0)
{
if(WlanEnumInterfaces(ClientHandle,0,&ilist)==0)
{
for (i = 0; i < ilist->dwNumberOfItems; i++) {
wprintf(L"%s%s\n",L"Interface:",ilist->InterfaceInfo[i].strInterfaceDescription);
if(WlanGetAvailableNetworkList(ClientHandle,&ilist->InterfaceInfo[i].InterfaceGuid,0,0,&nlist)==0){
for(c=0;c<nlist->dwNumberOfItems;c++)
{
memcpy(ssid,nlist->Network[c].dot11Ssid.ucSSID,nlist->Network[c].dot11Ssid.uSSIDLength);
ssid[nlist->Network[c].dot11Ssid.uSSIDLength]=0;
printf("SSID:%s",ssid);
wprintf(L"%s%d\n",L"\nQuality:",nlist->Network[c].wlanSignalQuality);
}
WlanFreeMemory(nlist);
}
}
WlanFreeMemory(ilist);
}
getch();
WlanCloseHandle(ClientHandle,0);
}
}
#2
#3
remark
#4
1楼貌似很强啊
#5
先看能不能解决他的问题
#6
楼主没说 是什么系统
linux的话
iwlist wlan0 scan
就能扫描出所有wifi节点的信息,包括 信号强度
linux的话
iwlist wlan0 scan
就能扫描出所有wifi节点的信息,包括 信号强度
#1
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
#include <windows.h>
#include<Wlanapi.h>
#pragma comment(lib, "wlanapi.lib")
int wmain()
{
HANDLE ClientHandle;DWORD nv,i,c;PWLAN_INTERFACE_INFO_LIST ilist;PWLAN_AVAILABLE_NETWORK_LIST nlist;static char ssid[36];
if(WlanOpenHandle(1,0,&nv,&ClientHandle)==0)
{
if(WlanEnumInterfaces(ClientHandle,0,&ilist)==0)
{
for (i = 0; i < ilist->dwNumberOfItems; i++) {
wprintf(L"%s%s\n",L"Interface:",ilist->InterfaceInfo[i].strInterfaceDescription);
if(WlanGetAvailableNetworkList(ClientHandle,&ilist->InterfaceInfo[i].InterfaceGuid,0,0,&nlist)==0){
for(c=0;c<nlist->dwNumberOfItems;c++)
{
memcpy(ssid,nlist->Network[c].dot11Ssid.ucSSID,nlist->Network[c].dot11Ssid.uSSIDLength);
ssid[nlist->Network[c].dot11Ssid.uSSIDLength]=0;
printf("SSID:%s",ssid);
wprintf(L"%s%d\n",L"\nQuality:",nlist->Network[c].wlanSignalQuality);
}
WlanFreeMemory(nlist);
}
}
WlanFreeMemory(ilist);
}
getch();
WlanCloseHandle(ClientHandle,0);
}
}
#2
#3
remark
#4
1楼貌似很强啊
#5
先看能不能解决他的问题
#6
楼主没说 是什么系统
linux的话
iwlist wlan0 scan
就能扫描出所有wifi节点的信息,包括 信号强度
linux的话
iwlist wlan0 scan
就能扫描出所有wifi节点的信息,包括 信号强度