Obtain the MAC address and IP address of the client Nic. JS code _ javascript tips-js tutorial

Source: Internet
Author: User
Obtain some information about the client, such as IP address and MAC address, in combination with identity authentication. I believe many people will do this. Here we use Javascript, the advantage of doing so is that the server does not need to be processed, and some clients can obtain it by themselves. If you are interested, you can refer to the following when you are working on a B/S structure system, we often need to obtain some information about the client, such as IP and MAC, in combination with identity authentication. It is easy to obtain the MAC address of the server, but it takes too much effort to obtain the MAC address of the client. The common practice is to call Win32API or directly call the nbtstat command, there are a lot of problems with this, and the other method is to directly use the client script. Here we use Javascript. The advantage of this is that it does not need to be processed by the server, but can be obtained by the client itself, it is passed to the server, and the speed and reliability are better than those obtained on the server.
The specific html and javascript implementations are as follows::

The Code is as follows:




WMI Scripting HTML

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.