mehmet07 Posted June 5, 2013 Share Posted June 5, 2013 hi, How do I get the Client pc MAC address? Quote Link to comment Share on other sites More sharing options...
Oliver Morsch Posted June 5, 2013 Share Posted June 5, 2013 hi, How do I get the Client pc MAC address? see here: http://stackoverflow.com/questions/9904100/how-to-get-client-machines-mac-address-in-a-web-application Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 5, 2013 Share Posted June 5, 2013 No you cannot get the MAC address in JavaScript, mainly because the MAC address uniquely identifies the running computer so it would be a security vulnerability.Now if all you need is a unique identifier, I suggest you create one yourself using some cryptographic algorithm and store it in a cookie.If you really need to know the MAC address of the computer AND you are developing for internal applications, then I suggest you use an external component to do that: ActiveX for IE, XPCOM for Firefox (installed as an extension). http://stackoverflow.com/questions/3385/mac-addresses-in-javascript Quote Link to comment Share on other sites More sharing options...
Jancarlos Martins Posted June 5, 2013 Share Posted June 5, 2013 Only IE, <script language="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;}</script> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.