获取本机mac地址

复制代码
function MacInfo(){
    //访问到WbemScripting对象
    var locator =new ActiveXObject ("WbemScripting.SWbemLocator");
    //访问本地电脑
    var service = locator.ConnectServer(".");
    //获取我们需要的对象的记录集
    var properties = service.ExecQuery("Select * from Win32_NetworkAdapterConfiguration Where IPEnabled =True");
    var e =new Enumerator (properties);
        var p = e.item();
        var mac = p.MACAddress;
        return mac;
}
复制代码

 

posted @   紫花地丁year  阅读(252)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示