I want to bind a program to a specific computer, and for that I want to use the serial number of the motherboard as unique identifier.
Although I could find some examples for C# and Java, I couldn't find anything reliable for C++ (I read WMI can fail depending on the hardware), but surely there's a way to do this in C++ too?
Edit : What I want is, in other words, like a simple and rudimentary licensing system. To make it more clear, here's how it would look like :
#define USER_SERIAL 123456789
double GetMotherBoardSerialNumber();
// ...
double currentSerial = GetMotherBoardSerialNumber();
if(currentSerial != USER_SERIAL) {
exit 1;
}
It is obviously not perfect, but I don't have any server atm to set up an account system so this could be a temporary solution.
You can look at this registry key:
[HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\BIOS]. You will see following:If this doesn't satisfy you, you can still use GetSystemInfo function. I think this use of motherboard information wouldn't help you as unique id. If you want to get unique computer identifier, use GUID or something. To create GUID you need to just: