Skip to content

Instantly share code, notes, and snippets.

@turbo
Last active January 18, 2017 15:02
Show Gist options
  • Save turbo/dbf59a8d9b4b857b3f1d5bf480526285 to your computer and use it in GitHub Desktop.
Save turbo/dbf59a8d9b4b857b3f1d5bf480526285 to your computer and use it in GitHub Desktop.
Hardware Fingerprint
public static string Value() {
if (string.IsNullOrEmpty(FingerPrint.fingerPrint)) {
object guid = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32).OpenSubKey("SOFTWARE\\Microsoft\\Cryptography").GetValue("MachineGuid");
if (guid == null) {
guid = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64).OpenSubKey("SOFTWARE\\Microsoft\\Cryptography").GetValue("MachineGuid");
FingerPrint.fingerPrint = guid.ToString();
} else FingerPrint.fingerPrint = guid.ToString();
}
return FingerPrint.fingerPrint;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment