From 9d1660270272180cd71147d6ddd53d1382643d2e Mon Sep 17 00:00:00 2001
From: wenxiangchao <wenxiangchao@ihengxin.com.cn>
Date: 星期一, 02 十一月 2026 18:00:14 +0800
Subject: [PATCH] merge: 并入远程 Initial commit 作为历史根节点
---
SimpleUtil/HMI.Util.Base/RegUtil.cs | 31 +++++++++++++++++++++++++++++++
1 files changed, 31 insertions(+), 0 deletions(-)
diff --git a/SimpleUtil/HMI.Util.Base/RegUtil.cs b/SimpleUtil/HMI.Util.Base/RegUtil.cs
new file mode 100644
index 0000000..1ea48f8
--- /dev/null
+++ b/SimpleUtil/HMI.Util.Base/RegUtil.cs
@@ -0,0 +1,31 @@
+锘縰sing Microsoft.Win32;
+using System;
+
+namespace HMI.Simple.Util
+{
+ public class RegUtil
+ {
+ private static string Company = "JingCe";
+ private static string Program = "HMI";
+
+ public static string GetLocaltion()
+ {
+ string registryPath = $@"SOFTWARE\{Company}\{Program}";
+ // 灏濊瘯鎵撳紑娉ㄥ唽琛ㄩ敭
+ using (RegistryKey key = Registry.CurrentUser.OpenSubKey(registryPath))
+ {
+ if (key == null)
+ {
+ throw new Exception("娉ㄥ唽琛ㄤ笉瀛樺湪锛岃鍏堣繍琛屼竴娆MI");
+ }
+
+ string value = key.GetValue("Location")?.ToString();
+ if (string.IsNullOrEmpty(value))
+ {
+ throw new Exception("娉ㄥ唽琛ㄤ笉瀛樺湪锛岃鍏堣繍琛屼竴娆MI");
+ }
+ return value;
+ }
+ }
+ }
+}
--
Gitblit v1.9.1