Remotely 开源项目使用教程
1. 项目的目录结构及介绍
Remotely 项目的目录结构如下:
Remotely/
├── Client/
│ ├── Remotely_Desktop/
│ ├── Remotely_Mobile/
│ └── Remotely_Web/
├── Server/
│ ├── Remotely_Server/
│ └── Remotely_Server.sln
├── Shared/
│ └── Remotely_Shared/
├── README.md
└── LICENSE
目录结构介绍
-
Client/: 包含所有客户端应用程序的代码。
- Remotely_Desktop/: 桌面客户端应用程序。
- Remotely_Mobile/: 移动客户端应用程序。
- Remotely_Web/: 网页客户端应用程序。
-
Server/: 包含服务器端应用程序的代码。
- Remotely_Server/: 服务器端应用程序的主要代码。
- Remotely_Server.sln: 服务器端应用程序的解决方案文件。
-
Shared/: 包含客户端和服务器端共享的代码。
- Remotely_Shared/: 共享代码库。
-
README.md: 项目说明文件。
-
LICENSE: 项目许可证文件。
2. 项目的启动文件介绍
服务器端启动文件
服务器端的启动文件位于 Server/Remotely_Server/
目录下,主要文件为 Program.cs
。
// Program.cs
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;
namespace Remotely.Server
{
public class Program
{
public static void Main(string[] args)
{
CreateHostBuilder(args).Build().Run();
}
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
});
}
}
客户端启动文件
客户端的启动文件根据不同的平台有所不同:
- 桌面客户端: 位于
Client/Remotely_Desktop/
目录下,主要文件为MainWindow.xaml.cs
。 - 移动客户端: 位于
Client/Remotely_Mobile/
目录下,主要文件为MainPage.xaml.cs
。 - 网页客户端: 位于
Client/Remotely_Web/
目录下,主要文件为index.html
。
3. 项目的配置文件介绍
服务器端配置文件
服务器端的配置文件位于 Server/Remotely_Server/
目录下,主要文件为 appsettings.json
。
{
"ConnectionStrings": {
"Default": "Server=(localdb)\\mssqllocaldb;Database=Remotely;Trusted_Connection=True;MultipleActiveResultSets=true"
},
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*"
}
客户端配置文件
客户端的配置文件根据不同的平台有所不同:
- 桌面客户端: 位于
Client/Remotely_Desktop/
目录下,主要文件为appsettings.json
。 - 移动客户端: 位于
Client/Remotely_Mobile/
目录下,主要文件为appsettings.json
。 - 网页客户端: 位于
Client/Remotely_Web/
目录下,主要文件为config.js
。
以上是 Remotely 开源项目的目录结构、启动文件和配置文件的详细介绍。希望这份教程能帮助你更好地理解和使用该项目。