delphiuniqueserial-numberidentification

How to generate an unique computer id on Delphi?


How can I quickly generate an unique computer id for a delphi app? I used to do it easly with c#, but this failed sometimes. I do want the ID to be "static" but I don't care if the id changes because of a hardware change or OS reinstallation, I was planning to store it in the registry and check it when the app starts, and if it changed update the registry. (I know how to code the registry part, I only need help for the unique id).

Thanks.


Solution

  • Use the hard disk serial number or MAC address:

    https://stackoverflow.com/questions/331106/how-to-get-serial-number-from-hard-disks (dead link)
    Generating a unique machine id