Skip to content

Commit

Permalink
添加新的示例
Browse files Browse the repository at this point in the history
  • Loading branch information
JusterZhu committed Aug 20, 2024
1 parent 851be86 commit edd2fd2
Show file tree
Hide file tree
Showing 33 changed files with 345 additions and 0 deletions.
Binary file removed imgs/GeneralUpdate.ico
Binary file not shown.
Binary file removed imgs/GeneralUpdate.png
Binary file not shown.
Binary file removed imgs/GeneralUpdate128.png
Binary file not shown.
13 changes: 13 additions & 0 deletions src/Client/.idea/.idea.ClientSample/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/Client/.idea/.idea.ClientSample/.idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions src/Client/.idea/.idea.ClientSample/.idea/indexLayout.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions src/Client/.idea/.idea.ClientSample/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions src/Client/ClientSample.csproj
Original file line number Diff line number Diff line change
@@ -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>
22 changes: 22 additions & 0 deletions src/Client/ClientSample.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClientSample", "ClientSample.csproj", "{F90306BE-A032-4C38-BE1A-7E1CAFEFB633}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F90306BE-A032-4C38-BE1A-7E1CAFEFB633}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F90306BE-A032-4C38-BE1A-7E1CAFEFB633}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F90306BE-A032-4C38-BE1A-7E1CAFEFB633}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F90306BE-A032-4C38-BE1A-7E1CAFEFB633}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
2 changes: 2 additions & 0 deletions src/Client/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// See https://aka.ms/new-console-template for more information
Console.WriteLine("Hello, World!");
17 changes: 17 additions & 0 deletions src/Client/build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
@echo off
REM 设置解决方案文件路径
set SOLUTION_PATH=ClientSample.sln

REM 导航到解决方案目录
cd /d %~dp0

REM 运行dotnet build命令
dotnet build %SOLUTION_PATH% -c Release

REM 检查构建是否成功
if %errorlevel% neq 0 (
echo Build failed
exit /b %errorlevel%
) else (
echo Build succeeded
)
Binary file removed src/FileService/~temp.vfs
Binary file not shown.
6 changes: 6 additions & 0 deletions src/Server/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();

app.MapGet("/", () => "Hello World!");

app.Run();
38 changes: 38 additions & 0 deletions src/Server/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"$schema": "http://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:11618",
"sslPort": 44380
}
},
"profiles": {
"http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "http://localhost:5046",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"https": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "https://localhost:7244;http://localhost:5046",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
9 changes: 9 additions & 0 deletions src/Server/ServerSample.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

</Project>
22 changes: 22 additions & 0 deletions src/Server/ServerSample.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ServerSample", "ServerSample.csproj", "{58E66EED-6599-41F1-A77B-2B0F79F543A1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{58E66EED-6599-41F1-A77B-2B0F79F543A1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{58E66EED-6599-41F1-A77B-2B0F79F543A1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{58E66EED-6599-41F1-A77B-2B0F79F543A1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{58E66EED-6599-41F1-A77B-2B0F79F543A1}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
8 changes: 8 additions & 0 deletions src/Server/appsettings.Development.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
}
}
9 changes: 9 additions & 0 deletions src/Server/appsettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*"
}
13 changes: 13 additions & 0 deletions src/StartManager/.idea/.idea.StartManager/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions src/StartManager/.idea/.idea.StartManager/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions src/StartManager/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace StartManager;

class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello, World!");
}
}
13 changes: 13 additions & 0 deletions src/StartManager/StartManager.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>latestmajor</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PublishAot>true</PublishAot>
<InvariantGlobalization>true</InvariantGlobalization>
</PropertyGroup>

</Project>
16 changes: 16 additions & 0 deletions src/StartManager/StartManager.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StartManager", "StartManager.csproj", "{71AEF1B1-59F0-422F-BE82-5C7EC1E00AFE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{71AEF1B1-59F0-422F-BE82-5C7EC1E00AFE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{71AEF1B1-59F0-422F-BE82-5C7EC1E00AFE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{71AEF1B1-59F0-422F-BE82-5C7EC1E00AFE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{71AEF1B1-59F0-422F-BE82-5C7EC1E00AFE}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
17 changes: 17 additions & 0 deletions src/Upgrade/.idea/.idea.UpgradeSample/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/Upgrade/.idea/.idea.UpgradeSample/.idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions src/Upgrade/.idea/.idea.UpgradeSample/.idea/indexLayout.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions src/Upgrade/.idea/.idea.UpgradeSample/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/Upgrade/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// See https://aka.ms/new-console-template for more information
Console.WriteLine("Hello, World!");
14 changes: 14 additions & 0 deletions src/Upgrade/UpgradeSample.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<None Remove="build.bat" />
</ItemGroup>

</Project>
22 changes: 22 additions & 0 deletions src/Upgrade/UpgradeSample.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UpgradeSample", "UpgradeSample.csproj", "{ECAB29C6-2EA8-458A-B822-DC0A4BDA93EE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{ECAB29C6-2EA8-458A-B822-DC0A4BDA93EE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ECAB29C6-2EA8-458A-B822-DC0A4BDA93EE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ECAB29C6-2EA8-458A-B822-DC0A4BDA93EE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ECAB29C6-2EA8-458A-B822-DC0A4BDA93EE}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
33 changes: 33 additions & 0 deletions src/build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
@echo off

REM 定义要启动的可执行文件路径
SET EXE_PATH=".\FileService\hfs.exe"

REM 启动指定的可执行文件
ECHO Starting executable: %EXE_PATH%
START "" %EXE_PATH%

REM 定义解决方案文件路径
SET SOLUTION_PATHS=(
".\Server\ServerSample.sln"
".\StartManager\StartManager.sln"
".\Upgrade\UpgradeSample.sln"
".\Client\ClientSample.sln"
)

REM 遍历解决方案文件并编译
FOR %%S IN %SOLUTION_PATHS% DO (
ECHO Compiling %%S...

REM 运行dotnet build命令
dotnet build %%S -c Release

IF !ERRORLEVEL! NEQ 0 (
ECHO Failed to build %%S
EXIT /B !ERRORLEVEL!
)
)

ECHO All solutions compiled successfully.

EXIT /B 0

0 comments on commit edd2fd2

Please sign in to comment.