如何在Javascript中获取客户端系统的MAC地址?

时间:2018-01-01 12:56:03

标签: javascript mac-address

我在PHP中得到答案,但由于会话而无效。

//Get the ipconfig details using system commond  
system('ipconfig /all');  
// Capture the output into a variable  
$mycomsys=ob_get_contents();  
// Clean (erase) the output buffer  

$find_mac = "Physical"; //find the "Physical" & Find the position of Physical text  
$pmac = strpos($mycomsys, $find_mac);  
// Get Physical Address  
$macaddress=substr($mycomsys,($pmac+36),17);  
ob_clean();  
//Display Mac Address
exec("/sbin/ifconfig eth0 | grep HWaddr", $output);
print_r( $output);die();

这满足了我的要求,但没有为我的应用程序运行,所以我需要在JavaScript中使用相同的功能。

0 个答案:

没有答案
相关问题