Reputation: 71
DriveInfo.GetDrives()
will enumerate all volumes mounted with a drive letter, but is there any way (without p/invoking Win32) to enumerate raw volumes, or to see volumes that may be mounted in a folder and not a drive letter?
Upvotes: 7
Views: 2829
Reputation: 13864
Yes, using WMI (Windows Management Interface)
The Win32_DiskDrive class contains information on physical hard drives, which can then be further examined to get a list of partitions.
There's also a decent tutorial on using WMI from C# and .Net
Upvotes: 6