Hard disk id of SATA drives

孤街浪徒 提交于 2019-12-20 06:39:31

问题


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

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

  1. MAC address
  2. HD id (SATA or IDE)
  3. 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


回答1:


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.



来源:https://stackoverflow.com/questions/8831024/hard-disk-id-of-sata-drives

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!