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
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
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;
}