Home >Web Front-end >JS Tutorial >Obtain the client network card MAC address and IP address to implement JS code_javascript skills
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: