js| Client
First, we know that there are several ways to manually view MAC addresses (the operating system I use is Windows XP):
1. Click on the menu "Start-All Programs-accessories-System Tools-System Information", then click "Component-Network-adapter" in the pop-up window, wait a moment, we can see the details of the network adapter on the right, including the MAC address.
2. Open the "Run" dialog box entered "CMD", and then in the Open Command Line window to enter "Ipconfig/all", press ENTER to find "Physical Address" item, this is the MAC addresses of the network card.
So what if you use a program to implement it? Here is a word about the implementation of JS, the following program to run before, please do the following settings:
Open IE tools-internet option-security-Custom Level-initializes the ActiveX control that is not marked as safe ...
Set this option to prompt
<script language= "JScript" event= "oncompleted (Hresult,perrorobject, Pasynccontext)" for= "foo" >
document.write (unescape (MACADDR));
</SCRIPT>
<script language= "JScript" event= "OnObjectReady (objobject,objasynccontext)" for= "foo" >
if (objobject.ipenabled!= null && objobject.ipenabled!= "undefined" && objobject.ipenabled = = True & & objobject.macaddress!= null && objobject.macaddress!= "undefined")
MACADDR = objobject.macaddress;
</SCRIPT>
<object id= "locator" classid= "Clsid:76a64158-cb41-11d1-8b02-00600806d9b6"
Viewastext></object>
<object id= "foo" classid= "clsid:75718c9a-f029-11d1-a1ac-00c04fb6c223" ></OBJECT>
<script language= "JScript" >
var service = Locator. ConnectServer ();
var macaddr;
var ipaddr;
var domainaddr;
var sdnsname;
Service. Security_. impersonationlevel=3;
Service. Instancesofasync (foo, ' Win32_NetworkAdapterConfiguration ');
</SCRIPT>
Run the above program, you can see the network card address