F
Flix
I need to detect the root directories of the installed hard disks (es: C:,
D:, E:, etc.). I'm not interested in cd drives.
I know that there is a way (a bit slow, if I remeber) to retrive all the
drives using a code like this:
ManagementClass diskClass = new ManagementClass("Win32_LogicalDisk");
ManagementObjectCollection disks = diskClass.GetInstances();
foreach (ManagementObject disk in disks) {
Console.WriteLine("Disk = " + disk["deviceid"]);
}
But I need only hard drives.
D:, E:, etc.). I'm not interested in cd drives.
I know that there is a way (a bit slow, if I remeber) to retrive all the
drives using a code like this:
ManagementClass diskClass = new ManagementClass("Win32_LogicalDisk");
ManagementObjectCollection disks = diskClass.GetInstances();
foreach (ManagementObject disk in disks) {
Console.WriteLine("Disk = " + disk["deviceid"]);
}
But I need only hard drives.