Recently in contact with the Software registration module, you need to obtain the hard drive serial number to generate the registration code.
HDD serial number, English name: Hard disk Serial number, which is the drive manufacturers to differentiate products and set, is unique. Search the Internet, found that the code to get the hard drive serial number is everywhere, but many are wrong. A typical representation is to use the GetVolumeInformation function to get the serial number. This method obtains the serial number of the volume, that is, volume Serial. This serial number will change after the hard drive is formatted. This article describes the method of acquiring a physical serial number that is unique to the hard disk.
How to get the hard drive serial number: https://www.winsim.com/diskid32/diskid32.html, if the error C2011 when compiling, That's because some of the structure and winioctl.h in the code are heavy, and you can delete the diskid32 inside.
C + + Get Hard drive serial number