第1个回答 推荐于2018-04-05
先添加对System.Management的引用
using System.Management;
...
SelectQuery selectQuery = new SelectQuery("select * from win32_logicaldisk");
ManagementObjectSearcher searcher = new ManagementObjectSearcher(selectQuery);
int i = 0;
foreach (ManagementObject disk in searcher.Get())
{
//获取驱动器盘符
this.listBox1.Items.Add(disk["Name"].ToString());
}本回答被提问者和网友采纳