有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java与无线

我正在使用Jacob查找我的无线NIC检测到的所有接入点的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();    
                }
        }

}

共 (0) 个答案