From 9f72a0c361eaea367b09c722b35d06d59a0d29ba Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期三, 02 八月 2023 18:07:49 +0800 Subject: [PATCH] 1 --- ExportMap/cs/Tools.cs | 20 ++++++++++++++++++++ 1 files changed, 20 insertions(+), 0 deletions(-) diff --git a/ExportMap/cs/Tools.cs b/ExportMap/cs/Tools.cs index 000724c..b9ccb8d 100644 --- a/ExportMap/cs/Tools.cs +++ b/ExportMap/cs/Tools.cs @@ -8,6 +8,8 @@ using System.Diagnostics; using System.IO; using System.Linq; +using System.Net; +using System.Net.Sockets; using System.Reflection; using System.Runtime.InteropServices; using System.Runtime.Serialization; @@ -288,6 +290,24 @@ } } + /// <summary> + /// 鑾峰彇鏈満IP + /// </summary> + /// <returns></returns> + public static string GetLocalIP() + { + var host = Dns.GetHostEntry(Dns.GetHostName()); + foreach (var ip in host.AddressList) + { + if (ip.AddressFamily == AddressFamily.InterNetwork) + { + return ip.ToString(); + } + } + + return GetSetting("localIP"); + } + [DllImport("ReadLas.dll")] public extern static int get_las_cs(string file_name); } -- Gitblit v1.9.3