+ Reply to Thread
Results 1 to 2 of 2

Thread: Get the Mac-Addresses of a PC

  1. #1
    Junior Member
    Join Date
    Jan 2012

    Get the Mac-Addresses of a PC

    I am trying to read every single MAC-Address on a pc but i can't figure out how.
    I tried some methods that i found online but they seem to find only one mac-address!

    I'd appreciate if you helped me and thanks.
    Last edited by juniour; 11-09-2012 at 12:16 AM.

  2. #2
    Junior Member
    Join Date
    May 2012
    This code will show you the correct way of retrieving every Network interfaces Mac-Address.

    Okay here is the snippet :

            using System.Management;
            List<string> MacAddresses = new List<string>();
            // The Method
            private void GetMacAddress()
    	 // retrieve each network interface information
                using (var mc = new ManagementClass("Win32_NetworkAdapterConfiguration"))
                    foreach (ManagementObject mo in mc.GetInstances())
                        {   // get the mac address
                        catch { }
    Here i used a list to store each mac-address in , you can after that loop the list to get each mac-address string.

+ Reply to Thread

Tags for this Thread


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts