I'm looking to get data such as Size/Capacity, Serial No, Model No, Heads Sectors, Manufacturer and possibly SMART data.
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
You can use WMI Calls to access info about the hard disks.
//Requires using System.Management; & System.Management.dll Reference
You can use WMI to get most of the information you want, and there's an introduction to WMI here.
You should use the System.Management namespace:
For details on the members of the Win32_DiskDrive class, check out:
http://msdn.microsoft.com/en-us/library/aa394132(VS.85).aspx
The easiest way is to use WMI to get the required information. Take at look at the documentation for Win32___DiskDrive in MSDN, which contains a variety of standard drive properties. You can also try using the MSStorageDriver_ATAPISmartData WMI class, which I can't find any docs for at the moment, but should have all of the SMART data that you're looking for. Here's some basic sample code to enumerate all drives and get their properties: