From bd853857e059c1e5193fec2eb6ff4aac9a8b30c0 Mon Sep 17 00:00:00 2001 From: wanggang <76527413@qq.com> Date: Wed, 17 Apr 2019 18:17:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9C=AC=E5=9C=B0=E6=B2=A1?= =?UTF-8?q?=E6=9C=89192.168.3ip=E6=97=B6=E8=BF=94=E5=9B=9E=E7=A9=BA?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- projects/Infrastructure/Extensions/HelperExtensions.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/projects/Infrastructure/Extensions/HelperExtensions.cs b/projects/Infrastructure/Extensions/HelperExtensions.cs index ff4e85b9..09ee1b8b 100644 --- a/projects/Infrastructure/Extensions/HelperExtensions.cs +++ b/projects/Infrastructure/Extensions/HelperExtensions.cs @@ -48,7 +48,10 @@ namespace Infrastructure.Extensions } } } - var ip = ipList.Where(o => o.ToString().StartsWith("192.168.3")).FirstOrDefault(); + var ip = ipList.Where(o => !o.ToString().StartsWith("10.") && o.ToString().StartsWith("172.") && o.ToString().StartsWith("192.")) + .FirstOrDefault() ?? ipList.FirstOrDefault(o => !o.ToString().StartsWith("192.168.")) + ?? ipList.FirstOrDefault(o => !o.ToString().StartsWith("192.")) + ?? ipList.FirstOrDefault(); return ip; }