I want to get MAC address of both Wireless network adapter and the ethernet adapter of a computer by using C#. I came across NetworkInterface.GetPhysicalAddress method (http://msdn.microsoft.com/en-us/library/system.net.networkinformation.physicaladdress%28v=vs.110%29.aspx) but I am not sure whether it will return both the address (wireless/ethernet) or any one address. Can someone clarify this and can you also provide a code snippet which is actually capable of fetching both the addresses if they exist in the computer (i.e. if both the adapters are present in the computer)
I am not sure whether it will return both the address
- why not try and see?!can you also provide a code snippet
- why not try example from your linked documentation Examples section? – Renatas M.NetworkInterface
for each adapter. The MSDN article you link to shows you how to get the mac adressess of all the network adapters in the machine. – Ben Robinson