From eb66e5e120736094935feffc1417dd421a1ea80b Mon Sep 17 00:00:00 2001 From: czw <selecti@yeah.net> Date: 星期四, 10 七月 2025 11:42:55 +0800 Subject: [PATCH] 1 --- 2025年6月12日/AuxAllWCS/Build/Project/代码/VS自定义类/AutoThread.cs | 16 ++++++++++++++-- 1 files changed, 14 insertions(+), 2 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/AutoThread.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/AutoThread.cs" index 8845f98..b7d2aec 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/AutoThread.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/AutoThread.cs" @@ -146,14 +146,25 @@ device1.Js鎹烽『2.Config.IP, device1.缁村笇灏旀姄鑷�.Config.IP, device1.缁村笇灏旀姄鑷�.Config.IP, - device1.RGV.Config.IP + device1.RGV.Config.IP, + device1.S1002Read.Config.IP, + device1.S2001Read.Config.IP, + device1.S3001Read.Config.IP }) { string pattern = @"\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b"; var matches = Regex.Match(ip, pattern); if (matches.Success) - IsMachineOnline(matches.Value); + { + var b = IsMachineOnline(matches.Value); + if (!Iponlines.ContainsKey(ip)) + { + Iponlines.TryAdd(ip, b); + } + else + Iponlines[ip] = b; + } } } catch (Exception ex) @@ -183,6 +194,7 @@ Task.WaitAll(tasks.ToArray()); } + public static ConcurrentDictionary<string, bool> Iponlines = new ConcurrentDictionary<string, bool>(); public bool IsMachineOnline(string hostNameOrIp, int timeout = 1000) { //device.p鍙戦偅绉�涓嬬嚎.Config.IP -- Gitblit v1.9.1