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/ConsoleApp7/Program.cs
2025-11-15 20:25:57 +08:00

27 lines
815 B
C#

namespace ConsoleApp7
{
internal class Program
{
static void Main()
{
DriveInfo[] allDrives = DriveInfo.GetDrives();
foreach (DriveInfo d in allDrives)
{
Console.WriteLine(d.Name);
Console.WriteLine(d.DriveType);
if (d.IsReady == true)
{
Console.WriteLine("卷标{0}", d.VolumeLabel);
Console.WriteLine("文件系统{0}", d.DriveFormat);
Console.WriteLine("可用空间{0,15}bytes", d.AvailableFreeSpace);
Console.WriteLine("总可用空间{0,15}bytes", d.TotalFreeSpace);
Console.WriteLine("磁盘总大小{0,15}bytes", d.TotalSize);
}
}
}
}
}