Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

MAC addresses in JavaScript

function showMacAddress() {
    var obj = new ActiveXObject("WbemScripting.SWbemLocator");
    var s = obj.ConnectServer(".");
    var properties = s.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration");
    var e = new Enumerator(properties);
    var output;
    output = '<table border="0" cellPadding="5px" cellSpacing="1px" bgColor="#CCCCCC">';
    output = output + '<tr bgColor="#EAEAEA"><td>Caption</td><td>MACAddress</td></tr>';
    while (!e.atEnd()) {
        e.moveNext();
        var p = e.item();
        if (!p) continue;
        output = output + '<tr bgColor="#FFFFFF">';
        output = output + '<td>' + p.Caption; +'</td>';
        output = output + '<td>' + p.MACAddress + '</td>';
        output = output + '</tr>';
    }
    output = output + '</table>';
    document.getElementById("box").innerHTML = output;
}

showMacAddress();
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript array split empty string 
Javascript :: update node js 
Javascript :: install three js fiber 
Javascript :: node.js name of file 
Javascript :: how to use filter in typescript 
Javascript :: js wait for element to load 
Javascript :: canvas rounded corners on image 
Javascript :: javascript random int 
Javascript :: react native font based on viewport dimensions 
Javascript :: Environment key "jest/globals" is unknown 
Javascript :: jquery grab table row 
Javascript :: jquery with npm in laravel 
Javascript :: setstate find opject in state and update 
Javascript :: leaflet control zoom on scrolling page 
Javascript :: access variable from another function javascript 
Javascript :: jquery onclick anchor tag scroll to div with exact position 
Javascript :: how to make text channels in discord.js 
Javascript :: ReactJS Axios Delete Request Code Example 
Javascript :: array join 
Javascript :: find smallest number in array javascript using for loop 
Javascript :: Configure the Chrome debugger react 
Javascript :: vue add external script 
Javascript :: how to get input name in javascript 
Javascript :: js wait until 2 promises are resolved 
Javascript :: moment localization 
Javascript :: firefox freeze page 
Javascript :: mutable array methods in javascript 
Javascript :: return object list in find js 
Javascript :: js match any number string 
Javascript :: js connect to websocket 
ADD CONTENT
Topic
Content
Source link
Name
7+1 =