Hard Disk Serial Number Delphi
Get Hard Disk Serial Number Delphi
I am using Hard disk ID for my software to check if the authentic user is using the software.For IDE type hard disk i get the id using the procedure GetIdeSerialNumber.
but in case of SATA drives it gives the id as blank.
Then in case of SATA drives i am using volume id as unique id.
but volume id will change when system is formatted
Does everybody know a reliable way of obtaining hard disk serial number? (I've got 3 different approaches from 3 different sources. Only one worked with Delphi, and it crashes in some systems.) Thanx! Please, answer by e-mail. I need this as soon as posible. Easy to read the unique serial number of hard disk in your Delphi project. The TGetDiskSerial VCL is a VCL component. You can use it to read the serial number of hard disk easily. As we all know, this serial number is unique in the world. So this component is of great use.
Now I want to know which hard drive i am using ,and how to get the hard disk id of SATA drive in delphi 7 ?
EDIT: the software according to client specifications needs to be locked to the hardware, the ID's concerned are
- MAC address
- HD id (SATA or IDE)
- Controller ID (this is motor to drive the hardware of which the software is delvped, the ID is unique)
The client has accpted the if system is changed the the authentication layer will fail,but we have been given the go ahead for the software locking to hardware..
so i wanted to know how to get the SATA ID
PresleyDias1 Answer
WMI is your best bet for retrieving the hard drive serial number, though older versions of Windows (95 and 98) aren't supported.
I recommend that you use the volume serial number. It's hardware agnostic. It will be tied to that installation of Windows instead of the physical hard drive. This makes a lot of sense and should be good enough.
Note that the user will have to reactivate if they reinstall Windows or some other restore situations, so you need to allow some leeway. That's the trickiest part to implement. Of course, that's the reason to use multiple IDs. You allow one or more to change, just not all of them, without requiring reactivation.
Marcus AdamsMarcus Adams