Skip to content

Commit edd2fd2

Browse files
committedAug 20, 2024
添加新的示例
1 parent 851be86 commit edd2fd2

33 files changed

+345
-0
lines changed
 

‎imgs/GeneralUpdate.ico

-16.6 KB
Binary file not shown.

‎imgs/GeneralUpdate.png

-15.9 KB
Binary file not shown.

‎imgs/GeneralUpdate128.png

-19.1 KB
Binary file not shown.

‎src/Client/.idea/.idea.ClientSample/.idea/.gitignore

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/Client/.idea/.idea.ClientSample/.idea/.name

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/Client/.idea/.idea.ClientSample/.idea/indexLayout.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/Client/.idea/.idea.ClientSample/.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/Client/ClientSample.csproj

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net8.0</TargetFramework>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
</PropertyGroup>
9+
10+
</Project>

‎src/Client/ClientSample.sln

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.0.31903.59
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClientSample", "ClientSample.csproj", "{F90306BE-A032-4C38-BE1A-7E1CAFEFB633}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(SolutionProperties) = preSolution
14+
HideSolutionNode = FALSE
15+
EndGlobalSection
16+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
17+
{F90306BE-A032-4C38-BE1A-7E1CAFEFB633}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
18+
{F90306BE-A032-4C38-BE1A-7E1CAFEFB633}.Debug|Any CPU.Build.0 = Debug|Any CPU
19+
{F90306BE-A032-4C38-BE1A-7E1CAFEFB633}.Release|Any CPU.ActiveCfg = Release|Any CPU
20+
{F90306BE-A032-4C38-BE1A-7E1CAFEFB633}.Release|Any CPU.Build.0 = Release|Any CPU
21+
EndGlobalSection
22+
EndGlobal

‎src/Client/Program.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// See https://aka.ms/new-console-template for more information
2+
Console.WriteLine("Hello, World!");

‎src/Client/build.bat

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
@echo off
2+
REM 设置解决方案文件路径
3+
set SOLUTION_PATH=ClientSample.sln
4+
5+
REM 导航到解决方案目录
6+
cd /d %~dp0
7+
8+
REM 运行dotnet build命令
9+
dotnet build %SOLUTION_PATH% -c Release
10+
11+
REM 检查构建是否成功
12+
if %errorlevel% neq 0 (
13+
echo Build failed
14+
exit /b %errorlevel%
15+
) else (
16+
echo Build succeeded
17+
)

‎src/FileService/~temp.vfs

-535 Bytes
Binary file not shown.

‎src/Server/Program.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
var builder = WebApplication.CreateBuilder(args);
2+
var app = builder.Build();
3+
4+
app.MapGet("/", () => "Hello World!");
5+
6+
app.Run();
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"$schema": "http://json.schemastore.org/launchsettings.json",
3+
"iisSettings": {
4+
"windowsAuthentication": false,
5+
"anonymousAuthentication": true,
6+
"iisExpress": {
7+
"applicationUrl": "http://localhost:11618",
8+
"sslPort": 44380
9+
}
10+
},
11+
"profiles": {
12+
"http": {
13+
"commandName": "Project",
14+
"dotnetRunMessages": true,
15+
"launchBrowser": true,
16+
"applicationUrl": "http://localhost:5046",
17+
"environmentVariables": {
18+
"ASPNETCORE_ENVIRONMENT": "Development"
19+
}
20+
},
21+
"https": {
22+
"commandName": "Project",
23+
"dotnetRunMessages": true,
24+
"launchBrowser": true,
25+
"applicationUrl": "https://localhost:7244;http://localhost:5046",
26+
"environmentVariables": {
27+
"ASPNETCORE_ENVIRONMENT": "Development"
28+
}
29+
},
30+
"IIS Express": {
31+
"commandName": "IISExpress",
32+
"launchBrowser": true,
33+
"environmentVariables": {
34+
"ASPNETCORE_ENVIRONMENT": "Development"
35+
}
36+
}
37+
}
38+
}

‎src/Server/ServerSample.csproj

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net8.0</TargetFramework>
5+
<Nullable>enable</Nullable>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
</PropertyGroup>
8+
9+
</Project>

‎src/Server/ServerSample.sln

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.0.31903.59
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ServerSample", "ServerSample.csproj", "{58E66EED-6599-41F1-A77B-2B0F79F543A1}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(SolutionProperties) = preSolution
14+
HideSolutionNode = FALSE
15+
EndGlobalSection
16+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
17+
{58E66EED-6599-41F1-A77B-2B0F79F543A1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
18+
{58E66EED-6599-41F1-A77B-2B0F79F543A1}.Debug|Any CPU.Build.0 = Debug|Any CPU
19+
{58E66EED-6599-41F1-A77B-2B0F79F543A1}.Release|Any CPU.ActiveCfg = Release|Any CPU
20+
{58E66EED-6599-41F1-A77B-2B0F79F543A1}.Release|Any CPU.Build.0 = Release|Any CPU
21+
EndGlobalSection
22+
EndGlobal
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"Logging": {
3+
"LogLevel": {
4+
"Default": "Information",
5+
"Microsoft.AspNetCore": "Warning"
6+
}
7+
}
8+
}

‎src/Server/appsettings.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"Logging": {
3+
"LogLevel": {
4+
"Default": "Information",
5+
"Microsoft.AspNetCore": "Warning"
6+
}
7+
},
8+
"AllowedHosts": "*"
9+
}

‎src/StartManager/.idea/.idea.StartManager/.idea/.gitignore

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/StartManager/.idea/.idea.StartManager/.idea/indexLayout.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/StartManager/.idea/.idea.StartManager/.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/StartManager/Program.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
namespace StartManager;
2+
3+
class Program
4+
{
5+
static void Main(string[] args)
6+
{
7+
Console.WriteLine("Hello, World!");
8+
}
9+
}

‎src/StartManager/StartManager.csproj

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net8.0</TargetFramework>
6+
<LangVersion>latestmajor</LangVersion>
7+
<ImplicitUsings>enable</ImplicitUsings>
8+
<Nullable>enable</Nullable>
9+
<PublishAot>true</PublishAot>
10+
<InvariantGlobalization>true</InvariantGlobalization>
11+
</PropertyGroup>
12+
13+
</Project>

‎src/StartManager/StartManager.sln

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StartManager", "StartManager.csproj", "{71AEF1B1-59F0-422F-BE82-5C7EC1E00AFE}"
4+
EndProject
5+
Global
6+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
7+
Debug|Any CPU = Debug|Any CPU
8+
Release|Any CPU = Release|Any CPU
9+
EndGlobalSection
10+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
11+
{71AEF1B1-59F0-422F-BE82-5C7EC1E00AFE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
12+
{71AEF1B1-59F0-422F-BE82-5C7EC1E00AFE}.Debug|Any CPU.Build.0 = Debug|Any CPU
13+
{71AEF1B1-59F0-422F-BE82-5C7EC1E00AFE}.Release|Any CPU.ActiveCfg = Release|Any CPU
14+
{71AEF1B1-59F0-422F-BE82-5C7EC1E00AFE}.Release|Any CPU.Build.0 = Release|Any CPU
15+
EndGlobalSection
16+
EndGlobal

‎src/Upgrade/.idea/.idea.UpgradeSample/.idea/.gitignore

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/Upgrade/.idea/.idea.UpgradeSample/.idea/.name

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/Upgrade/.idea/.idea.UpgradeSample/.idea/indexLayout.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/Upgrade/.idea/.idea.UpgradeSample/.idea/inspectionProfiles/Project_Default.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/Upgrade/.idea/.idea.UpgradeSample/.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/Upgrade/Program.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// See https://aka.ms/new-console-template for more information
2+
Console.WriteLine("Hello, World!");

‎src/Upgrade/UpgradeSample.csproj

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net8.0</TargetFramework>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
</PropertyGroup>
9+
10+
<ItemGroup>
11+
<None Remove="build.bat" />
12+
</ItemGroup>
13+
14+
</Project>

‎src/Upgrade/UpgradeSample.sln

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.0.31903.59
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UpgradeSample", "UpgradeSample.csproj", "{ECAB29C6-2EA8-458A-B822-DC0A4BDA93EE}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(SolutionProperties) = preSolution
14+
HideSolutionNode = FALSE
15+
EndGlobalSection
16+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
17+
{ECAB29C6-2EA8-458A-B822-DC0A4BDA93EE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
18+
{ECAB29C6-2EA8-458A-B822-DC0A4BDA93EE}.Debug|Any CPU.Build.0 = Debug|Any CPU
19+
{ECAB29C6-2EA8-458A-B822-DC0A4BDA93EE}.Release|Any CPU.ActiveCfg = Release|Any CPU
20+
{ECAB29C6-2EA8-458A-B822-DC0A4BDA93EE}.Release|Any CPU.Build.0 = Release|Any CPU
21+
EndGlobalSection
22+
EndGlobal

‎src/build.bat

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
@echo off
2+
3+
REM 定义要启动的可执行文件路径
4+
SET EXE_PATH=".\FileService\hfs.exe"
5+
6+
REM 启动指定的可执行文件
7+
ECHO Starting executable: %EXE_PATH%
8+
START "" %EXE_PATH%
9+
10+
REM 定义解决方案文件路径
11+
SET SOLUTION_PATHS=(
12+
".\Server\ServerSample.sln"
13+
".\StartManager\StartManager.sln"
14+
".\Upgrade\UpgradeSample.sln"
15+
".\Client\ClientSample.sln"
16+
)
17+
18+
REM 遍历解决方案文件并编译
19+
FOR %%S IN %SOLUTION_PATHS% DO (
20+
ECHO Compiling %%S...
21+
22+
REM 运行dotnet build命令
23+
dotnet build %%S -c Release
24+
25+
IF !ERRORLEVEL! NEQ 0 (
26+
ECHO Failed to build %%S
27+
EXIT /B !ERRORLEVEL!
28+
)
29+
)
30+
31+
ECHO All solutions compiled successfully.
32+
33+
EXIT /B 0

0 commit comments

Comments
 (0)