From eeafbc3b64818c90c79ed024c79619d46165339f Mon Sep 17 00:00:00 2001 From: czw <selecti@yeah.net> Date: 星期三, 02 七月 2025 10:17:00 +0800 Subject: [PATCH] 1 --- 2025年6月12日/AuxAllWCS/Build/Project/代码/VS自定义类/TcpServer.cs | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-) diff --git "a/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/\344\273\243\347\240\201/VS\350\207\252\345\256\232\344\271\211\347\261\273/TcpServer.cs" "b/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/\344\273\243\347\240\201/VS\350\207\252\345\256\232\344\271\211\347\261\273/TcpServer.cs" index 7bb9c73..f91b6bd 100644 --- "a/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/\344\273\243\347\240\201/VS\350\207\252\345\256\232\344\271\211\347\261\273/TcpServer.cs" +++ "b/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/\344\273\243\347\240\201/VS\350\207\252\345\256\232\344\271\211\347\261\273/TcpServer.cs" @@ -14,7 +14,7 @@ public class TcpServer { - public static Dictionary<string,string> TrayIps = new Dictionary<string,string>(); + public static Dictionary<string, string> TrayIps = new Dictionary<string, string>(); public TcpServer(string ip) { Init(ip); @@ -115,15 +115,18 @@ //} //else //{ - Console.WriteLine($"銆怲CP淇℃伅鍗忚寮傚父 {DateTime.Now.Millisecond}銆戯細IP锛歿remote_ip},MSG锛歿message}"); + Console.WriteLine($"銆怲CP淇℃伅鍗忚 {DateTime.Now.Millisecond}銆戯細IP锛歿remote_ip},MSG锛歿message}"); var mg = Encoding.ASCII.GetString(PlcHelper.Hex2Bin(message)); Console.WriteLine(mg); if (mg.StartsWith("DK") && mg.Trim().Length == "DK01000024".Length) { - if(TrayIps.TryGetValue(remote_ip,out string traycode)) + LogHelper.Info($"鎵爜鍣�>{remote_ip} -{mg}"); + if (TrayIps.TryGetValue(remote_ip, out string traycode)) { TrayIps[remote_ip] = traycode; - }else TrayIps.Add(remote_ip, traycode); + } + else TrayIps.Add(remote_ip, traycode); + Console.WriteLine("TOFF"); var mst = PlcHelper.Hex2Bin("544F4646"); TcpServer.TcpServerSend(remote_ip, mst); -- Gitblit v1.9.1