locked
how to fetch system hardware addresses using c# RRS feed

  • Question

  • hi.

    i m developing an application in which i want to fetch all the hardware address or id using code and wants to store into the database.

    please help me how can i fetch the address or id using code.

    Wednesday, July 21, 2010 4:15 AM

Answers

  • You could use the NMAPI to get teh NIC Adapter info and access the MAC Address.  the NM_NIC_ADAPTER_INFO contains that information and can be retrieved by calling NmGetAdapter.  For more information you can look at the Network Monitor 3.4 help file.

    There are other internal OS calls to get this information using NDIS.  This is another option for you if you don't want to install Network Monitor.

    Paul

    • Marked as answer by Paul E Long Wednesday, July 21, 2010 5:16 PM
    Wednesday, July 21, 2010 5:12 PM

All replies

  • You could use the NMAPI to get teh NIC Adapter info and access the MAC Address.  the NM_NIC_ADAPTER_INFO contains that information and can be retrieved by calling NmGetAdapter.  For more information you can look at the Network Monitor 3.4 help file.

    There are other internal OS calls to get this information using NDIS.  This is another option for you if you don't want to install Network Monitor.

    Paul

    • Marked as answer by Paul E Long Wednesday, July 21, 2010 5:16 PM
    Wednesday, July 21, 2010 5:12 PM
  • BTW, while it's unmanaged, there is a simple C# wrapper that uses PINVOKE to call into the DLL.
    Wednesday, July 21, 2010 5:16 PM