I have part of code where getting "real" HD SerialNumber. My intention is to
use it for protection of my application. I am not sure is that a good idea?
Anyway, code below reads all HD (more than one if are present) and I would
like to read only one disk, on c:\ if is possible.
ManagementObjectSearcher searcher = new
ManagementObjectSearcher("SELECT * FROM
Win32_PhysicalMedia");
int i = 0;
foreach(ManagementObject wmi_HD in searcher.Get())
{
// get the hardware serial no.
if (wmi_HD["SerialNumber"] == null)
SerialNo = "None";
else
SerialNo = wmi_HD["SerialNumber"].ToString();
++i;
}
Well, I would like to know is possible to get a serial number of HD only for
main disk?
What are you thing is better to use CPU number or something in order to set
a good program protection?
Thanks in advance.