- Home /
why SystemInfo.deviceUniqueIdentifier can be changed
i use SystemInfo.deviceUniqueIdentifier for Identify a unique system.
but When I connect a device to the computer ( like : flash memory , or external hdd ), the unique device identifier is changed.
why? it is so bad.
please Help :(
Answer by KarbonatErol · Oct 01, 2013 at 12:50 PM
Hi,
I have encountered the same problem and now we are using the hash of MAC address. A developer here stated that the deviceUniqueIdentifier IS the hash of the MAC address.
This is the code to get the MAC address (I have found it somewhere else on the internet, but I don't have the source):
using System.Net.NetworkInformation;
private string GetMacAddress() {
NetworkInterfaceType networkInterfaceType = 0;
string macAddress = "";
NetworkInterface[] theNetworkInterfaces =
NetworkInterface.GetAllNetworkInterfaces();
foreach (NetworkInterface currentInterface in theNetworkInterfaces)
{
networkInterfaceType = currentInterface.NetworkInterfaceType;
if (networkInterfaceType == NetworkInterfaceType.Ethernet
|| networkInterfaceType == NetworkInterfaceType.GigabitEthernet
|| networkInterfaceType == NetworkInterfaceType.FastEthernetFx)
{
macAddress = currentInterface.GetPhysicalAddress().ToString();
break;
}
}
return macAddress;
}
Apple have banned use of the ethernet address, it was the big news in iOS7
I haven't heard of it, and I'm pretty glad that we aren't developing for iOS :)
Your answer
Follow this Question
Related Questions
Support for System.Management in Unity, getting TypeLoader Exception 1 Answer
How to detect gpu name? 2 Answers
The type or namespace name "Management" does not exist in the namespace 1 Answer
Accessing local system ( File Browser ) 2 Answers
TimeZoneInfo.GetSystemTimeZones().Count gives 0 for unity android app 0 Answers