You need to determine what you are currently calling a "machine."
If I replace the processor, memory and hard drive, is this the same computer? Network adapter, graphics card?
What defines a machine?
There are many and many libraries for licensing to do this for you, but almost everything is for payment (because, supposedly, you only want to protect commercial software in this way). See what RSA, Verisign, and even Microsoft have to offer. The Windows API does not disclose this, supposedly to prevent hacking.
Alternatively, do it yourself. This is not easy to do, the difficult part determines what you consider a machine.
If you decide to track 5 things (HD, network card, video card, motherboard, memory cards), and you allow 3 changes before requiring a new license, then users can duplicate the hard drive, remove two of the above, put them in a new machine, replace their new parts on the old machine and run your program on two separate computers.
So it takes some thought.
-Adam
source share