Home >Web Front-end >JS Tutorial >Obtain the client network card MAC address and IP address to implement JS code_javascript skills

Obtain the client network card MAC address and IP address to implement JS code_javascript skills

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

When building a system with a B/S structure, we often need to obtain some information about the client, such as IP and MAC, in order to combine it with identity authentication. It is easy to obtain the MAC of the server, but it does take a lot of effort to obtain the MAC address of the client. The usual method is to call Win32API or directly call the nbtstat command. There are many problems with this. The other method is to directly use the client For side scripts, we use Javascript here. The advantage of this is that it does not require server-side processing. The client obtains it by itself and passes it to the server. The speed and reliability are better than obtaining it on the server side.
The specific implementation of html and javascript is as follows:

Copy code The code is as follows:



WMI Scripting HTML





9A -F029-11d1-A1AC-00C04FB6C223>










In fact, the most important thing is to use two ActiveX :
Copy code The code is as follows:

< /OBJECT>

However, these two ActiveXs come with the system, so there is no need to download or register them.
The next step is to use a script to interact with ActiveX. The script can be js or Vbs.
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