none
IE浏览器通过activeX获取mac地址错误 RRS feed

  • 问题

  • IE浏览器通过activeX获取mac,发现获取mac与另外一台机的一样,而非唯一的mac地址。并且该mac地址在同一台机上偶尔能获取。mac地址值是固定为:20:41:53:59:4E:FF。为什么会出现这情况?这种获取方式原理是什么?

    主要代码如下:

    <object classid="CLSID:76A64158-CB41-11D1-8B02-00600806D9B6" id="locator" style="display:none;visibility:hidden"></object>
    <object classid="CLSID:75718C9A-F029-11d1-A1AC-00C04FB6C223" id="foo" style="display:none;visibility:hidden"></object> 

    <script>

    var sMacAddr;

    var service = locator.ConnectServer(); 
    service.Security_.ImpersonationLevel=3; 
    service.InstancesOfAsync(foo, 'Win32_NetworkAdapterConfiguration');  
    <script FOR="foo" EVENT="OnObjectReady(objObject,objAsyncContext)" LANGUAGE="JScript"> 
             sMacAddr = objObject.MACAddress; // mac地址   
    </script>

    2019年7月18日 10:57

全部回复

  • Hi xinyp,

    有关IE的问题,我建议你到以下论坛进行提问,

    Internet Explorer Web Development

    Regards,

    Kyle


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    2019年7月19日 7:37
    版主