查找客户端计算机的mac地址 [英] Finding mac address of client machine

查看:67
本文介绍了查找客户端计算机的mac地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何查找客户端计算机的MAC地址

How to find MAC address of client computer

推荐答案

这是当天的分配吗?几个小时前我确实回答了完全相同的问题。你们发帖前都不看!:doh:

如何获取mac我的电脑在PHP中的地址 [ ^ ]
Is it assignment of the day? I did replied the exact same question few hours back. You guys don''t look before posting!:doh:
how to get the mac address of my pc in php[^]


它取决于运行的安全级别页面。如果你使用一些提升的权限运行脚本,在Windows机器上,下面的代码片段之一可以工作



It depends on security level page runs on. If you are running script using some elevated privileges, on a windows machine, one of code snippets below below could work

for (var arr = [], enum_ = new Enumerator(GetObject('WinMgmts:\\\\.\\Root\\CIMV2').ExecQuery('SELECT * FROM Win32_NetworkAdapter', 'WQL', 0x10 | 0x20)); !enum_.atEnd(); enum_.moveNext()) {
    var mac = enum_.item().MACAddress;
    mac && arr.push(mac);
}
WScript.Echo(arr.join('\n'));













var arr = [], WScriptExec = WScript.CreateObject('WScript.Shell').Exec('ipconfig /all');
while (!WScriptExec.status) WScript.Sleep(100);
WScript.Echo(WScriptExec.StdOut.ReadAll().match(/(?:[\da-f]{2}\-){5}[\da-f]{2}/gi).join('\n'));







从网页上看,除非您使用某些未记录的功能或特定组件,否则将无法获取MAC地址。




From the web page, unless you use some undocumented feature or specific component, it would not be possible to get the MAC address.


这篇关于查找客户端计算机的mac地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆