Search code examples
c#windows-phone-8

Windows Phone 8 - Mac Address


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?


Solution

  • 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...