From 770e5cbc81cfa1abc47667a9cdba8c81c64e858e Mon Sep 17 00:00:00 2001 From: z8018 <1282578289@qq.com> Date: 星期五, 28 二月 2025 17:19:40 +0800 Subject: [PATCH] 1 --- 项目代码/WIDESEAWCS_Server 正式/WIDESEAWCS_Server/Program.cs | 11 +++++------ 1 files changed, 5 insertions(+), 6 deletions(-) diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEAWCS_Server \346\255\243\345\274\217/WIDESEAWCS_Server/Program.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEAWCS_Server \346\255\243\345\274\217/WIDESEAWCS_Server/Program.cs" index 694b64e..92ffe97 100644 --- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEAWCS_Server \346\255\243\345\274\217/WIDESEAWCS_Server/Program.cs" +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEAWCS_Server \346\255\243\345\274\217/WIDESEAWCS_Server/Program.cs" @@ -23,7 +23,6 @@ using Microsoft.AspNetCore.Builder; using WIDESEA_SerialPortService; using WIDESEA_ISerialPortService; -using WIDESEA_SerialPortTestService; var builder = WebApplication.CreateBuilder(args); @@ -86,11 +85,11 @@ builder.Services.AddSingleton<ISerialPortService, SerialPortService>(); // 注册 SerialPortTestService,并注入 ISerialPortService -builder.Services.AddSingleton<SerialPortTestService>(sp => -{ - var serialPortService = sp.GetRequiredService<ISerialPortService>(); - return new SerialPortTestService("COM3", serialPortService); -}); +//builder.Services.AddSingleton<SerialPortTestJob>(sp => +//{ +// var serialPortService = sp.GetRequiredService<ISerialPortService>(); +// return new SerialPortTestJob("COM3", serialPortService); +//}); //// 注入 SerialPortService //builder.Services.AddScoped<ISerialPortService, SerialPortService>(); -- Gitblit v1.9.3