3

I know it wasn't possible to retrieve the Mac Address of the WIFI adapter in Windows Phone 7 - 7.5, but is it possible in Windows Phone 8? If so, how?

lhan
  • 4,585
  • 11
  • 60
  • 105
Thizzer
  • 16,153
  • 28
  • 98
  • 139
  • I expect not, I dont know what you wan't to do with it, but for Identity you can better use the UDID http://stackoverflow.com/questions/13975315/get-unique-device-id-udid-under-windows-phone-8 – EaterOfCode May 31 '13 at 13:28
  • It is for Identity, but for all other platforms we also use the mac address so it would be nice to maintain some coherence in that part. – Thizzer May 31 '13 at 13:37

1 Answers1

4

With this code:

Microsoft.Phone.Net.NetworkInformation.NetworkInterfaceList InterfacesList = new Microsoft.Phone.Net.NetworkInformation.NetworkInterfaceList();

You can obtain all Interfaces connected in your Device.

You want obtain all informations of every connected interfaces with that :

foreach (Microsoft.Phone.Net.NetworkInformation.NetworkInterfaceInfo specificInterface in InterfacesList)
    {
        if (specificInterface.InterfaceType == Microsoft.Phone.Net.NetworkInformation.NetworkInterfaceType.Wireless80211)
        {
           Console.WriteLine("This interface is a Wifi Interface :");
        }

        Console.WriteLine("Bandwidth :" + specificInterface.Bandwidth);
        Console.WriteLine("Characteristics :" + specificInterface.Characteristics);
        Console.WriteLine("Description :" + specificInterface.Description);
        Console.WriteLine("InterfaceName :" + specificInterface.InterfaceName);
        Console.WriteLine("InterfaceType :" + specificInterface.InterfaceType);

    }

You can go to the MSDN for more information about NetworkInterfaceInfo

But, They are not MAC Adress information! you can use "Description", it is the ID of the network card...

Doc Roms
  • 3,288
  • 1
  • 20
  • 37
  • I know is unique In the device (Lumia 920) but I don't know if is totally Unique. But, You can create an Very_Unique_Id for your card with guid and description Card combine : string UniqueCardId = GUID + CARDDESCRIPTION; – Doc Roms May 31 '13 at 14:35