Local machine's MAC address?

  • Thread starter Thread starter SJ
  • Start date Start date
S

SJ

How can I find the local Machine's MAC address using asp.net?

Thanks,
-SJ
 
couple options.

1) write an active/x control that lookup up the mac address
2) write a .net control hosted by browser (will require user configure full
trust)
3) if the clients are on the local lan, ask the dhcp or wins servers for the
transaction


--- bruce (sqlwork.com)
 
How can I find the local Machine's MAC address using asp.net?

The web server's or the client's?
 
If so, your original question is most confusing.

What does your problem have to do with asp.net?

To answer you question, try this:

ManagementClass mc = new ManagementClass("Win32_NetworkAdapter");
foreach (ManagementObject mo in mc.GetInstances())
{
string macAddr = mo["MACAddress"] as string;
if ( macAddr != null && macAddr.Trim() != "" )
return macAddr.ToString();
}



Eliyahu
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top