change - 包源修改

master
wenjy 9 months ago
parent 3b64dee043
commit 7935d4086a

@ -39,7 +39,7 @@ namespace Ems.CollectService.Analysis
private BufferAnalysis() private BufferAnalysis()
{ {
logger.Info($"版本更新修复连接ID重复主动断开原有连接信息建立新连接"); logger.Info($"添加校时指令下发");
} }
/// <summary> /// <summary>
@ -154,7 +154,7 @@ namespace Ems.CollectService.Analysis
if(SendMessageAsync(client, SendMessagePackInfo)) if(SendMessageAsync(client, SendMessagePackInfo))
{ {
logger.Debug($"向客户端:{client.ID};地址:{client.GetIPPort()};回复心跳指令成功"); logger.Debug($"向客户端:{client.ID};地址:{client.GetIPPort()};回复心跳指令成功");
Thread.Sleep(500); Thread.Sleep(1000);
SendMessagePackInfo.m_MessageType = (byte)CallbackSendData._SetTime; SendMessagePackInfo.m_MessageType = (byte)CallbackSendData._SetTime;
SendMessagePackInfo.m_PackLen = new byte[] {0x00, 0x0D}; SendMessagePackInfo.m_PackLen = new byte[] {0x00, 0x0D};
bool isRes = SendTimeSyncToClient(client, SendMessagePackInfo); bool isRes = SendTimeSyncToClient(client, SendMessagePackInfo);

@ -8,7 +8,6 @@
<PackageReference Include="Nancy" Version="2.0.0" /> <PackageReference Include="Nancy" Version="2.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" /> <PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
<PackageReference Include="NLog.Web.AspNetCore" Version="5.2.3" /> <PackageReference Include="NLog.Web.AspNetCore" Version="5.2.3" />
<PackageReference Include="System.Drawing.Common" Version="4.7.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

@ -3,9 +3,6 @@ using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text;
using System.Text.Json.Serialization;
using System.Xml.Linq;
namespace Ems.CollectService.Common namespace Ems.CollectService.Common
{ {

@ -188,40 +188,7 @@ namespace Ems.CollectService.Common
} }
#endregion #endregion
/// <param name="strbase64">64Base码</param>
/// <param name="path">保存路径</param>
/// <param name="filename">文件名称</param>
/// <returns></returns>
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;
}
/// <summary> /// <summary>
/// 获取时间戳 /// 获取时间戳
/// </summary> /// </summary>

@ -15,6 +15,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Reflection.Metadata; using System.Reflection.Metadata;
using System.Threading.Tasks;
namespace Ems.CollectService namespace Ems.CollectService
{ {
@ -41,7 +42,12 @@ namespace Ems.CollectService
{ {
logger.Error($"服务启动异常{ex.Message}"); logger.Error($"服务启动异常{ex.Message}");
} }
Console.ReadLine(); //Console.ReadLine();
while (true)
{
Task.Delay(1000 * 10).Wait();
}
} }

Loading…
Cancel
Save