简体   繁体   中英

Get Mounted Drives in c#

DriveInfo.GetDrives()将枚举以驱动器号装载的所有卷,但是是否有任何方法(不带p /调用Win32)枚举原始卷,或查看可能安装在文件夹中而不是驱动器号的卷?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM