Get Hard Drive Serial Number Delphi

  • 1 Comments!

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. I built the code segment by using Delphi XE 7 and tested it on my. I use this to get hard drive serial number. How to read the serial no of hard disk?

Do The code you writen get manufatctor serial number and no body can clone it on other PC and it is Safe! Or what I do ( write in 1st Q?

Thanks, //-------------------------------- function GetDiskSerialNumber(Disk: char): string; var VolumeSerialNumber, MaximumComponentLength, FileSystemFlags: DWORD; SerialNumber: string; begin GetVolumeInformation(PChar(Disk + ': '), nil, 0, @VolumeSerialNumber, MaximumComponentLength, FileSystemFlags, nil, 0); SerialNumber:= Format('%.4X-%.4X', [HiWord(VolumeSerialNumber), LoWord(VolumeSerialNumber)]); Result:= SerialNumber; end; Please give a point. Oasis@eurosoft.lv beginner! Thanks to all, Alikhany ( halikhany@yahoo.com ) http://www.alikhany.tk/. Just my 2 (Euro) cents to the topic.

Get Hard Drive Serial Number Delphi

The routines based on GetVolumeInformation is not reliable to identify a PC, as it gives you the number, the disk got while formating it. If you use a disk image program (DiskImage, Nortom Ghost) to clone the drive, you will have 2 drives with identical information. Plus this information can be changed by software. Okay, direct disk access or fumbling with a disk editor is not for everyone but I'm sure there are some programs to be found on the net. IMHO the method that uses SMART technology is more reliable as it accesses the serialnumber and information the HDD manufacturer gave the drive and that is sored in hardware. Not sure if they can be changed by software. But be aware: we had one case of changing data on a Win2000 laptop after switching of without shutdown - it did the Scandisk on boot and voila - the data changed.

So it may be unique, but is not 100% stable HTH ) Verence. Sledki zefirki dlya vzroslih opisanie.