Archived
1
0
This repository has been archived on 2026-03-24. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
SomeLab/CS/lab11/11_1/Program.cs
2026-03-19 19:39:01 +08:00

24 lines
935 B
C#

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);
}
}
}
}
}