用VC/C++判断电脑有没有 无线网卡 的简单方法?

来源:百度知道 编辑:UC知道 时间:2024/07/04 14:54:22
可以用VC/C++编一个小程序,判断电脑有没有无线网卡吗?
我运行了lin1270的程序,报告说是"普通网卡",我的电脑是有无线网卡的,是不是必须正在使用无线网卡上网时才能检测到?我现在在使用有线上网。

#include <windows.h>
#include <wlanapi.h>
#include <iostream>
#pragma comment(lib, "wlanapi.lib")
void main(){
HANDLE hClient = NULL;
DWORD dwMaxClient = 2,dwCurVersion = 0;
PWLAN_INTERFACE_INFO_LIST pIfList = NULL;
WlanOpenHandle(dwMaxClient, NULL, &dwCurVersion, &hClient);
WlanEnumInterfaces(hClient, NULL, &pIfList);
std::cout << "发现无线网卡数量:" << pIfList->dwNumberOfItems<<std::endl;
WlanFreeMemory(pIfList);
}

#include <windows.h>
#include <stdio.h>

int main()
{
HKEY bKey,hKey;
LONG retVal;
DWORD dwBuf = 1;
DWORD dwLen;

char SubKey[] = "System\\CurrentControlSet\\Control\\Network\\{4D36E