我正在使用Jacob
查找无线网卡检测到的所有接入点的MAC地址。
根据WMI文档Ndis80211BSSIList
是:"The list of in-range BSSIDs and their properties"
。据我所知,它返回一个类MSNdis_80211_WLanBssId
的对象数组,每个对象都有一些属性。
我的问题是如何访问每个实例的这些属性(每个实例都是具有MAC地址或SSID等属性的不同BSSID)。任何帮助都是有价值的。
public class testWMIJacob {
public static void main(String[] args) {
String host = "localhost";
String connectStr = String.format("winmgmts:\\\\%s\\root\\wmi", host);
String query = "SELECT * FROM MSNdis_80211_BSSIList ";
ActiveXComponent axWMI = new ActiveXComponent(connectStr);
Variant vCollection = axWMI.invoke("ExecQuery", new Variant(query));
EnumVariant enumVariant = new EnumVariant(vCollection.toDispatch());
Dispatch item = null;
while (enumVariant.hasMoreElements()) {
item = enumVariant.nextElement().toDispatch();
String req = Dispatch.call(item,"Ndis80211BSSIList").toString();
}
}
}