Sign in to follow this  

[C++, Windows/wxWidgets] Uniquely identify a PC

This topic is 2663 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

As part of a licensing system I am trying to get a way to generate a (near-)unique code based on a PC's hardware setup. Nothing too fancy, it doesn't have to be guaranteed unique. We considered MAC address but I believe on laptops network cards can be commonly deactivated in powersaving mode, etc - on the same PC the software should generate the same code barring actual substantial changes.
In C++ on Win32 or through wxWidgets, what are some obvious things to try and read, and how can they be read? I assume it's not a good idea to base it on software at all, only hardware - so things like CPU ID or hard-disk serial, etc.

And yes I know this potentially causes issues if someone upgrades. Other than avoiding really obvious hardware changes, it's been agreed this is OK - let's not get into discussing the rights and wrongs please, I've already been through that [wink]

Share this post


Link to post
Share on other sites
You could get the motherboard serial and other serial numbers through WMI. I have gathered these numbers before, for statistical purposes in a monitoring application, the code to obtain them is searchable on MSDN.

Note though that some cheaper or generic hardware has no serial number field, in this case you get an empty string and have to use something else in its place!

Share this post


Link to post
Share on other sites

This topic is 2663 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this