Question : Get unique id of Device
Answered by : ayaz-ullah-sharif
//******************* Source: NAYCode.com
private string GetDeviceInfo() { string mac = string.Empty; string ip = string.Empty; foreach (var netInterface in NetworkInterface.GetAllNetworkInterfaces()) { if (netInterface.NetworkInterfaceType == NetworkInterfaceType.Wireless80211 || netInterface.NetworkInterfaceType == NetworkInterfaceType.Ethernet) { var address = netInterface.GetPhysicalAddress(); mac = BitConverter.ToString(address.GetAddressBytes()); IPAddress[] addresses = Dns.GetHostAddresses(Dns.GetHostName()); if (addresses != null && addresses[0] != null) { ip = addresses[0].ToString(); break; } } } return mac; }
Source : http://naycode.com/Xamarin/mac-address-in-xamarin-android | Last Update : Mon, 22 Nov 21