Click here to Skip to main content
13,052,900 members (63,665 online)
Rate this:
Please Sign up or sign in to vote.
See more:
i want to display ip address and mac address of pc i have the following code but it does not working in my system please check this..
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Getting MAC Address From Javascript(IE Only)</title>
<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>';
		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>';
	<input type="button" value="Show MAC Address" onclick="showMacAddress()" />
	<div id="box">
Posted 1-Apr-13 21:02pm
Updated 1-Apr-13 21:06pm
Style-7 2-Apr-13 4:58am
this may be disable by admin policy
this is not safe for user
Madhugundi 3-Apr-13 1:29am
means what

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 2 Apr 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100