![]() Read more about the Win32_NetworkAdapterConfiguration object here (VS.85). Now the client can see his/her own MAC and IP Addresses. Then we can simply use textboxes to display that information or whatever you like.ĭocument.getElementById( "txtMACAdress").value = unescape(macAddress) ĭocument.getElementById( "txtIPAdress").value = unescape(ipAddress) ĭocument.getElementById( "txtComputerName").value = unescape(computerName) Īnd just like before, make sure to place the declarations snippet above this script for it to display the values properly. ![]() Instead of Win32_Processor, here we'll access Win32_NetworkAdapterConfiguration to read network related details like the MAC Address, IP Address and the computer name. ![]() Var wmi = GetObject( "winmgmts:") Į = new Enumerator(wmi.ExecQuery( "SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True")) You can never get the MAC address of a user connected to your website, when a socket connection occurs between the destination (your website's server) and a source (client's computer) you can only get the source IP address, for the MAC address it's never sent over the socket connection. ![]() Ok if you're done reading, you'll notice we simply change the script to this: This is somewhat similar to the previous post Get client cpu id with javascript, so the client still needs to enable ActiveX components on his browser.
0 Comments
Leave a Reply. |