重新发布的工作代码
(我试图从我的 ActiveX 组件中获取数组,但没有运气。当我运行脚本时,我得到空的消息框,但我知道数组在那里:)
var objMain, objAdapt, lgCount, stMsg = "";
objMain = new ActiveXObject("nnetcom.oMain");
objMain.UnlockComponent("xxx-xxxxx-xxxxx-xx");
objAdapt = new ActiveXObject("nnetcom.oNetworkAdapter");
objAdapt.GetNetworkAdapters(); // Collects Network Adapters
vrAdapters = objAdapt.cName; // cName holds collected Network Adapter names
var vrAdaptVB = new VBArray(vrAdapters);
var vrAdaptJS = vrAdaptVB.toArray();
for (lgCount in vrAdaptJS) {
stMsg = stMsg + vrAdaptJS[lgCount] + '\r\n';
}
WScript.Echo(stMsg);
objAdapt = null
objMain = null