namespace _11_1 { internal class Program { static void Main(string[] args) { DriveInfo[] allDrives = DriveInfo.GetDrives(); foreach (DriveInfo driveInfo in allDrives) { Console.WriteLine("驱动器{0}\t",driveInfo.Name); Console.WriteLine("类型{0}\t",driveInfo.DriveType); if (driveInfo.IsReady == true) { Console.WriteLine("卷标{0}\t",driveInfo.VolumeLabel); Console.WriteLine("文件系统{0}\t",driveInfo.DriveFormat); Console.WriteLine("当前用户可用空间{0,15}字节\t", driveInfo.AvailableFreeSpace); Console.WriteLine("可用空间{0,15}字节\t", driveInfo.TotalFreeSpace); Console.WriteLine("总空间{0:15}字节\t",driveInfo.TotalSize); } } } } }