1
czw
2025-07-02 a54f394767fe561f8ed7e3d5b13bcb42868815cf
2025Äê6ÔÂ12ÈÕ/AuxAllWCS/Build/Project/´úÂë/VS×Ô¶¨ÒåÀà/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($"【TCP信息协议异常 {DateTime.Now.Millisecond}】:IP:{remote_ip},MSG:{message}");
                        Console.WriteLine($"【TCP信息协议 {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);