XFEExtension.NetCore.ServerInteractive
1.1.0
dotnet add package XFEExtension.NetCore.ServerInteractive --version 1.1.0
NuGet\Install-Package XFEExtension.NetCore.ServerInteractive -Version 1.1.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="XFEExtension.NetCore.ServerInteractive" Version="1.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="XFEExtension.NetCore.ServerInteractive" Version="1.1.0" />
<PackageReference Include="XFEExtension.NetCore.ServerInteractive" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add XFEExtension.NetCore.ServerInteractive --version 1.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: XFEExtension.NetCore.ServerInteractive, 1.1.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package XFEExtension.NetCore.ServerInteractive@1.1.0
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=XFEExtension.NetCore.ServerInteractive&version=1.1.0
#tool nuget:?package=XFEExtension.NetCore.ServerInteractive&version=1.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
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 | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- System.Management (>= 10.0.3)
- XFEExtension.NetCore (>= 3.3.10)
- XFEExtension.NetCore.AutoConfig (>= 2.0.7)
- XFEExtension.NetCore.AutoImplement (>= 1.1.0)
- XFEExtension.NetCore.XFEConsole (>= 1.2.3)
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 |
|---|---|---|
| 1.1.0 | 30 | 3/1/2026 |
| 1.0.15 | 221 | 10/14/2025 |
| 1.0.14 | 193 | 10/14/2025 |
| 1.0.13 | 146 | 10/11/2025 |
| 1.0.12 | 144 | 10/11/2025 |
| 1.0.11 | 138 | 10/11/2025 |
| 1.0.10 | 143 | 10/11/2025 |
| 1.0.9 | 161 | 10/10/2025 |
| 1.0.8 | 169 | 10/10/2025 |
| 1.0.7 | 172 | 10/10/2025 |
| 1.0.6 | 197 | 10/8/2025 |
| 1.0.5 | 205 | 10/5/2025 |
| 1.0.4 | 132 | 9/27/2025 |
| 1.0.3 | 181 | 9/26/2025 |
| 1.0.2 | 156 | 9/26/2025 |
| 1.0.1 | 218 | 9/24/2025 |
| 1.0.0 | 210 | 9/24/2025 |
## 调整
修复用户重新登录时的校验问题
## 新增
无
## 严重
无