From 7935d4086a1b92e52926f1124e5c9908866231e4 Mon Sep 17 00:00:00 2001 From: wenjy Date: Tue, 16 Apr 2024 09:04:48 +0800 Subject: [PATCH] =?UTF-8?q?change=20-=20=E5=8C=85=E6=BA=90=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Ems.CollectService.Analysis/BufferAnalysis.cs | 4 +-- .../Ems.CollectService.Common.csproj | 1 - Ems.CollectService.Common/JsonChange.cs | 3 -- Ems.CollectService.Common/StringChange.cs | 35 +------------------ Ems.CollectService/Program.cs | 8 ++++- 5 files changed, 10 insertions(+), 41 deletions(-) diff --git a/Ems.CollectService.Analysis/BufferAnalysis.cs b/Ems.CollectService.Analysis/BufferAnalysis.cs index 224fac1..3db84b3 100644 --- a/Ems.CollectService.Analysis/BufferAnalysis.cs +++ b/Ems.CollectService.Analysis/BufferAnalysis.cs @@ -39,7 +39,7 @@ namespace Ems.CollectService.Analysis private BufferAnalysis() { - logger.Info($"版本更新,修复连接ID重复,主动断开原有连接信息建立新连接"); + logger.Info($"添加校时指令下发"); } /// @@ -154,7 +154,7 @@ namespace Ems.CollectService.Analysis if(SendMessageAsync(client, SendMessagePackInfo)) { logger.Debug($"向客户端:{client.ID};地址:{client.GetIPPort()};回复心跳指令成功"); - Thread.Sleep(500); + Thread.Sleep(1000); SendMessagePackInfo.m_MessageType = (byte)CallbackSendData._SetTime; SendMessagePackInfo.m_PackLen = new byte[] {0x00, 0x0D}; bool isRes = SendTimeSyncToClient(client, SendMessagePackInfo); diff --git a/Ems.CollectService.Common/Ems.CollectService.Common.csproj b/Ems.CollectService.Common/Ems.CollectService.Common.csproj index d699c23..146b6d7 100644 --- a/Ems.CollectService.Common/Ems.CollectService.Common.csproj +++ b/Ems.CollectService.Common/Ems.CollectService.Common.csproj @@ -8,7 +8,6 @@ - diff --git a/Ems.CollectService.Common/JsonChange.cs b/Ems.CollectService.Common/JsonChange.cs index 62a1b71..83e57d4 100644 --- a/Ems.CollectService.Common/JsonChange.cs +++ b/Ems.CollectService.Common/JsonChange.cs @@ -3,9 +3,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; -using System.Text; -using System.Text.Json.Serialization; -using System.Xml.Linq; namespace Ems.CollectService.Common { diff --git a/Ems.CollectService.Common/StringChange.cs b/Ems.CollectService.Common/StringChange.cs index 4c80e2f..b1ed3a0 100644 --- a/Ems.CollectService.Common/StringChange.cs +++ b/Ems.CollectService.Common/StringChange.cs @@ -188,40 +188,7 @@ namespace Ems.CollectService.Common } #endregion - /// 64Base码 - /// 保存路径 - /// 文件名称 - /// - public bool Base64ToImage(string strbase64, string path, string filename) - { - bool Flag = false; - try - { - //base64编码的文本 转为 图片 - //图片名称 - byte[] arr = Convert.FromBase64String(strbase64);//将指定的字符串(它将二进制数据编码为 Base64 数字)转换为等效的 8 位无符号整数数组。 - using (MemoryStream ms = new MemoryStream(arr)) - { - Bitmap bmp = new Bitmap(ms);//加载图像 - if (!Directory.Exists(path))//判断保存目录是否存在 - { - Directory.CreateDirectory(path); - } - bmp.Save((path + "\\" + filename + ".png"), System.Drawing.Imaging.ImageFormat.Png);//将图片以JPEG格式保存在指定目录(可以选择其他图片格式) - ms.Close();//关闭流并释放 - if (File.Exists(path + "\\" + filename + ".png"))//判断是否存在 - { - Flag = true; - } - } - } - catch (Exception ex) - { - Console.WriteLine("图片保存失败:" + ex.Message); - } - return Flag; - } - + /// /// 获取时间戳 /// diff --git a/Ems.CollectService/Program.cs b/Ems.CollectService/Program.cs index 4906abd..429646f 100644 --- a/Ems.CollectService/Program.cs +++ b/Ems.CollectService/Program.cs @@ -15,6 +15,7 @@ using System; using System.Collections.Generic; using System.IO; using System.Reflection.Metadata; +using System.Threading.Tasks; namespace Ems.CollectService { @@ -41,7 +42,12 @@ namespace Ems.CollectService { logger.Error($"服务启动异常{ex.Message}"); } - Console.ReadLine(); + //Console.ReadLine(); + + while (true) + { + Task.Delay(1000 * 10).Wait(); + } }