统一归档20260319
This commit is contained in:
11
CS/lab11/11_1/11_1.csproj
Normal file
11
CS/lab11/11_1/11_1.csproj
Normal file
@@ -0,0 +1,11 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<RootNamespace>_11_1</RootNamespace>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
25
CS/lab11/11_1/11_1.sln
Normal file
25
CS/lab11/11_1/11_1.sln
Normal file
@@ -0,0 +1,25 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.14.36717.8 d17.14
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "11_1", "11_1.csproj", "{58CF9AA8-CE56-4C37-8A1D-760D77F94470}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{58CF9AA8-CE56-4C37-8A1D-760D77F94470}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{58CF9AA8-CE56-4C37-8A1D-760D77F94470}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{58CF9AA8-CE56-4C37-8A1D-760D77F94470}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{58CF9AA8-CE56-4C37-8A1D-760D77F94470}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {3AAF3249-007B-458C-8EE7-3E081A944087}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
23
CS/lab11/11_1/Program.cs
Normal file
23
CS/lab11/11_1/Program.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
3
CS/lab11/11_4/11_4.slnx
Normal file
3
CS/lab11/11_4/11_4.slnx
Normal file
@@ -0,0 +1,3 @@
|
||||
<Solution>
|
||||
<Project Path="11_4/11_4.csproj" />
|
||||
</Solution>
|
||||
11
CS/lab11/11_4/11_4/11_4.csproj
Normal file
11
CS/lab11/11_4/11_4/11_4.csproj
Normal file
@@ -0,0 +1,11 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<RootNamespace>_11_4</RootNamespace>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
34
CS/lab11/11_4/11_4/Program.cs
Normal file
34
CS/lab11/11_4/11_4/Program.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
namespace _11_4
|
||||
{
|
||||
internal class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
const string FILE_NAME = "output.txt";
|
||||
using (StreamWriter sw = new StreamWriter(FILE_NAME))
|
||||
{
|
||||
sw.WriteLine("---------------------");
|
||||
sw.WriteLine("文本文件读取写入示例");
|
||||
sw.WriteLine("---------------------");
|
||||
sw.WriteLine("写入整数、浮点数、bool值、字符、字符串、日期");
|
||||
Console.WriteLine("请输入一个整数");
|
||||
int i = int.Parse(Console.ReadLine());
|
||||
sw.WriteLine(i);
|
||||
Console.WriteLine("写入一个浮点数");
|
||||
double j = double.Parse(Console.ReadLine());
|
||||
sw.WriteLine(j);
|
||||
Console.WriteLine("写入一个bool值");
|
||||
bool k = bool.Parse(Console.ReadLine());
|
||||
sw.WriteLine(k);
|
||||
Console.WriteLine("写入一个字符");
|
||||
char a = char.Parse(Console.ReadLine());
|
||||
sw.WriteLine(k);
|
||||
Console.WriteLine("写入字符串");
|
||||
string b = Console.ReadLine();
|
||||
sw.WriteLine(b);
|
||||
Console.WriteLine("写入当前日期");
|
||||
sw.WriteLine(DateTime.Now);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
11
CS/lab11/15_2/15_2.csproj
Normal file
11
CS/lab11/15_2/15_2.csproj
Normal file
@@ -0,0 +1,11 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<RootNamespace>_15_2</RootNamespace>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
25
CS/lab11/15_2/15_2.sln
Normal file
25
CS/lab11/15_2/15_2.sln
Normal file
@@ -0,0 +1,25 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.14.36717.8 d17.14
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "15_2", "15_2.csproj", "{D437CE40-AC0B-464E-86CB-5D994033F3DC}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{D437CE40-AC0B-464E-86CB-5D994033F3DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{D437CE40-AC0B-464E-86CB-5D994033F3DC}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{D437CE40-AC0B-464E-86CB-5D994033F3DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D437CE40-AC0B-464E-86CB-5D994033F3DC}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {4A5F0527-7568-4AEE-BC4C-E898DFB182FE}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
37
CS/lab11/15_2/Program.cs
Normal file
37
CS/lab11/15_2/Program.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
namespace _15_2
|
||||
{
|
||||
internal class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
string path0 = @"c:\Windows\security";
|
||||
string path1 = @"c:\Windows";
|
||||
try
|
||||
{
|
||||
Console.WriteLine("当前工作目录:\n{0}", Directory.GetCurrentDirectory());
|
||||
string[] subDirectory = Directory.GetDirectories(Directory.GetDirectoryRoot(Directory.GetCurrentDirectory()));
|
||||
Console.WriteLine("根目录里的子目录数{0},其名称分别为:\n", subDirectory.Length);
|
||||
foreach (string items in subDirectory)
|
||||
{
|
||||
Console.WriteLine(items);
|
||||
}
|
||||
string[] dirs = Directory.GetFiles(path0);
|
||||
Console.WriteLine("{0}目录下文件总数{1},分别是", path0, dirs.Length);
|
||||
foreach (string items in dirs)
|
||||
{
|
||||
Console.WriteLine(items);
|
||||
}
|
||||
string[] dir1 = Directory.GetFiles(path1, "*.ini");
|
||||
Console.WriteLine("{0}目录下文件后缀为ini的文件总数{1},分别是", path0, dir1.Length);
|
||||
foreach (string items in dir1)
|
||||
{
|
||||
Console.WriteLine(items);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine("\n 操作失败:{0}",e.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
11
CS/lab11/15_3/11_3.csproj
Normal file
11
CS/lab11/15_3/11_3.csproj
Normal file
@@ -0,0 +1,11 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<RootNamespace>_15_3</RootNamespace>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
25
CS/lab11/15_3/11_3.sln
Normal file
25
CS/lab11/15_3/11_3.sln
Normal file
@@ -0,0 +1,25 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.14.36717.8 d17.14
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "11_3", "11_3.csproj", "{0AFD8847-31A3-4223-B6B7-234B5CA5D6AF}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{0AFD8847-31A3-4223-B6B7-234B5CA5D6AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{0AFD8847-31A3-4223-B6B7-234B5CA5D6AF}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{0AFD8847-31A3-4223-B6B7-234B5CA5D6AF}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{0AFD8847-31A3-4223-B6B7-234B5CA5D6AF}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {8AE52124-B68F-4F87-8E59-5ADFF5C51EC7}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
10
CS/lab11/15_3/Program.cs
Normal file
10
CS/lab11/15_3/Program.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
namespace _15_3
|
||||
{
|
||||
internal class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
Console.WriteLine("Hello, World!");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user