我有一个程序可以告诉我所有的硬盘/USB,但它只告诉我驱动器号而不是名称。这是我所拥有的:
DriveInfo[] drives = DriveInfo.GetDrives();
Console.WriteLine("Detected Drives: ");
for(int i = 0; i < drives.Count(); i++)
{
Console.WriteLine("Drive " + i + ": " + drives[i].Name);
}
return drives;
这打印:
Drive 0: C:\
Drive 1: E:\
但我想要这样的名字
Drive 0: C:\ Local disk
Drive 1: E:\ Kingston USB
我怎么得到这个?