- #Visual studio product key on laptop license key#
- #Visual studio product key on laptop code#
- #Visual studio product key on laptop mac#
+ identifier( " Win32_BIOS", " Version") + identifier( " Win32_BIOS", " ReleaseDate") + identifier( " Win32_BIOS", " SerialNumber") + identifier( " Win32_BIOS", " IdentificationCode") + identifier( " Win32_BIOS", " SMBIOSBIOSVersion") Return identifier( " Win32_BIOS", " Manufacturer") BIOS Identifier private static string biosId() RetVal += identifier( " Win32_Processor", " MaxClockSpeed") RetVal = identifier( " Win32_Processor", " Manufacturer") If (retVal = " ") // If no Name, use Manufacturer RetVal = identifier( " Win32_Processor", " Name") If (retVal = " ") // If no ProcessorId, use Name RetVal = identifier( " Win32_Processor", " ProcessorId") If (retVal = " ") // If no UniqueID, use ProcessorID Uses first CPU identifier available in order of preference // Don't get all identifiers, as it is very time consuming string retVal = identifier( " Win32_Processor", " UniqueId") Return a hardware identifier private static string identifier( string wmiClass, string wmiProperty) Only get the first one if (result = " ") moc = mc.GetInstances() įoreach ( mo in moc) ( string wmiClass, string wmiProperty, string wmiMustBeTrue) Return a hardware identifier private static string identifier Private static string GetHexString(byte bt) Return GetHexString(sec.ComputeHash(bt)) MD5 sec = new MD5CryptoServiceProvider() Private static string fingerPrint = string.Empty įingerPrint = GetHash( " CPU > " + cpuId() + " \nBIOS > " +
#Visual studio product key on laptop code#
/ /// Generates a 16 byte Unique Identification code of a computer The code in the region "Original Device ID Getting Code" is from the original author. So make the finger print generating function static and save it in a static variable so that it generates the key only once in the whole application.
#Visual studio product key on laptop mac#
Don't use MAC ID, Graphics Card ID AND Disk ID since it's very common to change these devices.Generate a key from only the Motherboard, Processor and BIOS since the user normally doesn't change these parts.The output is a nice looking key in hexadecimal format (eg. I added some additional code to generate a 128 bit key of a machine. Thanks to the original author of the code. Year ago, I found a very handy and useful code in C# by searching the Internet to get these IDs. When you get these IDs, you can generate any key of your preferable format. For this purpose, you can take help of the unique id of the client's computer motherboard, BIOS and processor.
#Visual studio product key on laptop license key#
For licensing purposes, according to me, the best and secure way is to generate a unique key for the client's machine and provide a corresponding license key for that key.