I need to check in C# if a hard disk is SSD (Solid-state drive), no seek penalty?
I used:
ManagementClass driveClass = new ManagementClass("Win32_DiskDrive");
ManagementObjectCollection drives = driveClass.GetInstances();
But its only gives Strings that contain SSD in the properties, I can’t depend on that?
I Need a direct way to check that?
WMI will not be able to determine this easily. There is a solution here that’s based on the same algorithm Windows 7 uses to determine if a disk is SSD (more on the algorithm here: Windows 7 Enhancements for Solid-State Drives, page 8 and also here: Windows 7 Disk Defragmenter User Interface Overview): Tell whether SSD or not in C#
A quote from the MSDN blog: