Home  >  Article  >  Web Front-end  >  获取客户端网卡MAC地址和IP地址实现JS代码_javascript技巧

获取客户端网卡MAC地址和IP地址实现JS代码_javascript技巧

WBOY
WBOYOriginal
2016-05-16 17:40:192080browse

在做B/S结构的系统时,我们常常需要获取客户端的一些信息,如IP和MAC,以结合身份验证。要获取服务器端的MAC很容易,但是要获取客户端的MAC的地址确要花费一翻心思,通常的做法是调用Win32API或直接调用nbtstat命令,这样做有很多问题,而另一种方法就是直接用客户端脚本,我们这里用Javascript,这样做的好处是不需要服务器端进行处理,有客户端自行获取,传递到服务器端,且速度和可靠性都比在服务器端获取好。
具体实现的html和javascript如下

复制代码 代码如下:



WMI Scripting HTML
















Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn