.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> ASP.Net >> Post New QuestionBookmark and Share Subscribe to Forum

how to get MAC Address of client machine not the server.

Posted By: Pawan kumar Shukla     Posted Date: May 15, 2011    Points:5   Category :ASP.Net
can any one tell me how to get the mac address of machine, using JavaScript or asp.net

Responses
Author: Mahesh             
Posted Date: May 16, 2011     Points: 20   

Hi,
Security settings prevent you from getting this information. On the client side or over a network website you can do it like this:

var strComputer = ".";
var objWMIService = GetObject("winmgmts:\\\\" + strComputer + "\\root\\cimv2");
var e = new Enumerator(objWMIService.ExecQuery("Select * from Win32_NetworkAdapter","WQL",48));

for (;!e.atEnd();e.moveNext())
{ objItem = e.item();
WScript.Echo ("MACAddress: " + objItem.MACAddress)
}

hope this helps..

Thanks
Mahesh



Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend