Link to home
Start Free TrialLog in
Avatar of VAM345
VAM345

asked on

Get Computer Unique ID

I need code to obtain a computer specific information, HDD serial number, BIOS date and so on.
Avatar of alexo
alexo
Flag of Antarctica image

This question pops about once or twice a month on EE.

If you want to do it for copy protection -- don't!  Two reasons:

1. This kind of copy protection is easy to break.

2. If a legitimate user upgrades his hardware and your program stops working, you'll get no return business and lots of bad publicity.

[I'm submitting this as a comment so you can delete the question]
Avatar of PeteI
PeteI

With the exception of network cards, there's no PC hardware that's guaranteed to have a unique ID.

There are some quasi-unique values that are relatively easy to obtain.  For instance, you can get a volume serial number (a DWORD based on the date and time the volume was formatted) by calling GetVolumeInformation().

One reasonable was to uniquely identify a PC is to create a GUID (CoCreateGuid) and stash it on the system -- the registry is a good place.  The chance of two GUIDs matching is astronomically remote.


Avatar of VAM345

ASKER

Volume serial number is easy to fake.
With GUID can`t sure to that is same computer. With out LAN card GUID is not similar digit, obtain thah is same machine.
VAM345, Your comment is difficult to understand.

Note that I didn't specify that the volume serial number is guaranteed unique.  It's not.  It is, however, a well-distributed value that is _unlikely_ to change over time.

A GUID is a Globally Unique Identifier.  That means a GUID created on one machine via CoCreateGuid() will never match a GUID created on any other machine ever again, regardless of whether or not the machine has a network card.
Avatar of VAM345

ASKER

Problem is I need to obtain ID every time when I start program ant check that is same mashine.
ASKER CERTIFIED SOLUTION
Avatar of ddgamer
ddgamer

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial