Home  >  Article  >  Web Front-end  >  js obtains the IP address and MAC address of the client network card_javascript skills

js obtains the IP address and MAC address of the client network card_javascript skills

WBOY
WBOYOriginal
2016-05-16 16:54:193010browse

复制代码 代码如下:










MAC地址:

IP地址:

主机名:








代码是网上找到,但是经过修改。

原因是比如你笔记本有多张网卡,会出现获取你未联网或者禁用网卡的信息,解决办法:加限制条件:

objObject.DNSServerSearchOrder!=null

加上这个限制条件后,就能取到联网客户端的网卡IP地址了。

不过还有个问题就是只能限制IE浏览器,而且Activex必须要全部启用。
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