static string GetSerial(int Index)
{
string DeviceName = String.Format(@"//./PHYSICALDRIVE{0}", Index);
ManagementClass mc = new ManagementClass("Win32_PhysicalMedia");
ManagementObjectCollection moc = mc.GetInstances();
int i = 0;
foreach (ManagementObject mo in mc.GetInstances())
{
if (i++ == Index)
return mo.Properties["SerialNumber"].Value.ToString();
}
return "";
}