I want to create an application which should work only on certain computers and for that I want to get hard drive serial number. Do I have any other option?
Using Win API (kernel32.dll) for can find a function called GetVolumeInformation which will give you the Volume Serial Number, but this should be avoided if you can help it as every time we format the same hard drive, a new Volume Serial Number is generated. What you would really want is the Manufacturers Serial Number for the hard drive but thats much harder to get. You have to use a WMI (Windows Machine Interface) in order to get this.