XFEExtension.NetCore.ServerInteractive
3.0.2-preview.1.26046.8
See the version list below for details.
dotnet add package XFEExtension.NetCore.ServerInteractive --version 3.0.2-preview.1.26046.8
NuGet\Install-Package XFEExtension.NetCore.ServerInteractive -Version 3.0.2-preview.1.26046.8
<PackageReference Include="XFEExtension.NetCore.ServerInteractive" Version="3.0.2-preview.1.26046.8" />
<PackageVersion Include="XFEExtension.NetCore.ServerInteractive" Version="3.0.2-preview.1.26046.8" />
<PackageReference Include="XFEExtension.NetCore.ServerInteractive" />
paket add XFEExtension.NetCore.ServerInteractive --version 3.0.2-preview.1.26046.8
#r "nuget: XFEExtension.NetCore.ServerInteractive, 3.0.2-preview.1.26046.8"
#:package XFEExtension.NetCore.ServerInteractive@3.0.2-preview.1.26046.8
#addin nuget:?package=XFEExtension.NetCore.ServerInteractive&version=3.0.2-preview.1.26046.8&prerelease
#tool nuget:?package=XFEExtension.NetCore.ServerInteractive&version=3.0.2-preview.1.26046.8&prerelease
XFEExtension.NetCore.ServerInteractive
描述
ServerInteractive是一个C#的DLL库,其负责搭建以XFEExtension.NetCore提供的CyberComm网络架构,让使用者可以快速构建服务器和客户端网络框架
示例(使用前记得进行相应的引用)
搭建服务器端网络框架
使用XFE标准网络架构
var server = XFEServerBuilder.CreateBuilder() // 创建服务器构建器
.UseXFEServer() // 使用XFE服务器架构
.AddServerCore( // 添加核心服务器
XFEServerCoreBuilder.CreateBuilder() // 创建核心服务器构建器
.UseXFEStandardServerCore<IUserFaceInfo>(options =>
{ // 使用XFE标准服务器核心
options.GetUserFunction = static () => UserProfile.UserTable; // 获取用户表的方法
options.GetEncryptedUserLoginModelFunction = static () => UserProfile.EncryptedUserLoginModelTable; // 获取用户加密模型的方法
options.AddEncryptedUserLoginModelFunction = UserProfile.EncryptedUserLoginModelTable.Add; // 添加用户加密模型的方法
options.RemoveEncryptedUserLoginModelFunction = static user => UserProfile.EncryptedUserLoginModelTable.Remove(user); // 移除用户加密模型的方法
options.GetLoginKeepDays = static () => 7; // 获取登录维持天数方法
options.LoginResultConvertFunction = static user => (IUserFaceInfo)user; // 登录结果转换方法
options.DataTableManagerBuilder = XFEDataTableManagerBuilder.CreateBuilder() // 创建DataTable管理器构建器
.AddTable<Person, DataProfile>("人物", (int)UserRole.业务员, (int)UserRole.经理, (int)UserRole.业务员, (int)UserRole.业务员) // 添加名为人物的格, Person 类 型, AutoConfig为 DataProfile。添加更改获取权限为业务员,移除权限为经理
.AddTable<Order, DataProfile>("订单", (int)UserRole.业务员, (int)UserRole.经理, (int)UserRole.业务员, (int)UserRole.业务员) // 添加名为订单的表格Order 类 型, AutoConfig 为 DataProfile。添加更改获取权限为业务员,移除权限为经理
.AddTable<User, UserProfile>("用户", (int)UserRole.经理, (int)UserRole.经理, (int)UserRole.经理, (int)UserRole.业务员); // 添加名为用户的表格User类 型, AutoConfig为 UserProfile。获取权限为业务员,添加移除更改权限为经理
})
.AddStandardService<TestCoreService>("test")
.Build()) // 构建核心服务器
.Build(); // 构建服务器
await server.Start(); // 启动服务
添加自定义服务
var server = XFEServerBuilder.CreateBuilder()
.AddInitializer<MyInitilizerService>() // 自定义初始化服务
.AddService<MyService>() // 自定义服务
.AddAsyncService<MyAsyncService>() // 自定义异步服务
.Build();
搭建客户端请求器
使用XFE标准请求器
var xFEClientRequester = XFEClientRequesterBuilder.CreateBuilder("http://localhost:8080/", string.Empty, DeviceHelper.GetUniqueHardwareId()) // 服务器IP地址,用户Session以及硬件编码
.UseXFEStandardRequest() // 使用XFE标准请求器
.Build(); // 构建客户端请求器
var result = await xFEClientRequester.Request<(string session, DateTime expireDate)>("login", account, password); // 调用login方法
if (result.StatusCode == System.Net.HttpStatusCode.OK)
{
Console.WriteLine(result.Result.session);
Console.WriteLine(result.Result.expireDate);
}
else
{
Console.WriteLine(result.StatusCode);
Console.WriteLine(result.Message);
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- System.Management (>= 10.0.5)
- XFEExtension.NetCore (>= 4.2.0)
- XFEExtension.NetCore.AutoConfig (>= 2.0.7)
- XFEExtension.NetCore.AutoImplement (>= 1.1.0)
- XFEExtension.NetCore.XFEConsole (>= 2.1.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.0.4 | 46 | 4/7/2026 |
| 3.0.3 | 55 | 4/7/2026 |
| 3.0.2 | 62 | 4/6/2026 |
| 3.0.2-preview.1.26046.8 | 42 | 4/6/2026 |
| 3.0.2-preview.1.26046.5 | 38 | 4/6/2026 |
| 3.0.2-preview.1.26046.4 | 35 | 4/6/2026 |
| 3.0.2-preview.1.26046.3 | 34 | 4/6/2026 |
| 3.0.2-preview.1.26046.2 | 35 | 4/6/2026 |
| 3.0.1 | 47 | 4/5/2026 |
| 3.0.1-preview.1.26046.1 | 33 | 4/5/2026 |
| 3.0.0 | 36 | 4/5/2026 |
| 2.5.1 | 47 | 4/5/2026 |
| 2.5.0 | 45 | 4/4/2026 |
| 2.4.0 | 75 | 3/28/2026 |
| 2.3.1 | 94 | 3/28/2026 |
| 2.3.0 | 129 | 3/28/2026 |
| 2.2.0 | 48 | 3/27/2026 |
| 2.1.0 | 52 | 3/27/2026 |
| 2.0.2 | 45 | 3/25/2026 |
| 2.0.1 | 42 | 3/25/2026 |
## 调整
Wildcard Route Matching and Registration:
Added support for registering and matching wildcard routes on the client side, ensuring the most specific pattern is chosen for requests, and preventing ambiguous aliasing to wildcard routes. This includes changes in both the builder (XFEClientRequesterBuilder) and the requester (XFEClientRequester). [1] [2] [3] [4] [5] [6]
Request Context Modernization:
Replaced the use of HttpListenerRequest with the more general CyberCommRequestEventArgs in core service interfaces and implementations, providing a compatibility shim for legacy access to the request object. [1] [2] [3] [4] [5] [6] [7]
Server Configuration Enhancements:
Enabled support for GET, POST, and non-standard JSON requests in the server's API entry point configuration.
## 新增
无
## 严重
无