111
This commit is contained in:
10
ConsoleApp7/ConsoleApp7.csproj
Normal file
10
ConsoleApp7/ConsoleApp7.csproj
Normal file
@@ -0,0 +1,10 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
25
ConsoleApp7/ConsoleApp7.sln
Normal file
25
ConsoleApp7/ConsoleApp7.sln
Normal file
@@ -0,0 +1,25 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.14.36623.8 d17.14
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp7", "ConsoleApp7.csproj", "{D142C263-3F9B-4B2C-96D8-91555668D07F}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{D142C263-3F9B-4B2C-96D8-91555668D07F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{D142C263-3F9B-4B2C-96D8-91555668D07F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{D142C263-3F9B-4B2C-96D8-91555668D07F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D142C263-3F9B-4B2C-96D8-91555668D07F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {A6F2247D-28F8-40E7-A68F-9A39C987FF1D}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
26
ConsoleApp7/Program.cs
Normal file
26
ConsoleApp7/Program.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user