Курсовая работа: Разработка программы "Формирование и проверка контрольной суммы кластеров"
Num_Hdd = Num_Hdd + 1;
TotalSize = TotalSize + double.Parse(wmi_HD["Size"].ToString());
}
#region //Getting HDD's serial under XP
if (OSXP == true)
{
searcher = new
ManagementObjectSearcher("SELECT * FROM Win32_PhysicalMedia");
int i = 0;
foreach (ManagementObject wmi_HD in searcher.Get())
{
// get the hard drive from collection
// using index
HardDrive hd = (HardDrive)hdCollection[i];
// get the hardware serial no.
if (wmi_HD["SerialNumber"] == null)
hd.SerialNo = "None";
else
hd.SerialNo = wmi_HD["SerialNumber"].ToString();
++i;
}
}
#endregion
searcher = new
ManagementObjectSearcher("SELECT * FROM Win32_LogicalDisk");
foreach (ManagementObject wmi_HD in searcher.Get())
{
// get how much Freespace the HDD have left...
if (wmi_HD["FreeSpace"] == null)