Here’s a way to get the local machine’s MAC address in C#. Note that there may be various MAC addresses (Ethernet cards, local loopback devices, hooked up 3G devices etc.), so we try to find only the Ethernet MAC address.

This article was posted by Independent Software, a website and database application development company based in Maputo, Mozambique. Our website offers regular write-ups on technical and design issues, ranging from details at code level to 3D Studio Max rendering. Read more about Independent Software's philosophy, or get in touch with Independent Software.

Here’s a way to get the local machine’s MAC address in C#. Note that there may be various MAC addresses (Ethernet cards, local loopback devices, hooked up 3G devices etc.), so we try to find only the Ethernet MAC address.


Comments

11 11 Responses to “Get local machine’s MAC address in C#”
  1. Naresh says:

    thanks. this was useful to me.

  2. prasad says:

    Thanks very much. That works finally

  3. Zafer says:

    Thanks.

  4. khan says:

    thanks..very useful…

  5. miki says:

    Be carefull, you should also check for wireless network, not only ethernet >> Wireless80211 <<

  6. yishagerew says:

    bravo!

  7. jay says:

    Nice Thnx…..

  8. nani says:

    nice one ,but localhost displays system mac address problem is when hosting in server system the mac address displays server mac address.i want to display local mac address when run the application from server

  9. Niyal says:

    hello,
    thanks for the code, but i need it in another way, i want to register pc’s mac address when i run installation of my application, can anyone help me out??

Leave a Reply

Your email address will not be published. Required fields are marked *