From bfd1ee252f0df95a341c50ce1e3d7f34cf3551a7 Mon Sep 17 00:00:00 2001 From: snltty <1069410172@qq.com> Date: Thu, 1 Feb 2024 18:03:33 +0800 Subject: [PATCH] test --- cmonitor/client/reports/system/SystemWindows.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmonitor/client/reports/system/SystemWindows.cs b/cmonitor/client/reports/system/SystemWindows.cs index bf15a2be..e7b4d603 100644 --- a/cmonitor/client/reports/system/SystemWindows.cs +++ b/cmonitor/client/reports/system/SystemWindows.cs @@ -183,8 +183,8 @@ namespace cmonitor.client.reports.system string delPathStr = pathStr.Replace("HKEY_CURRENT_USER\\", "").Replace("HKEY_LOCAL_MACHINE\\", ""); try { - RegistryKey _key = Registry.LocalMachine.OpenSubKey(delPathStr); - _key?.DeleteValue(path.Key); + RegistryKey _key = Registry.LocalMachine.OpenSubKey(delPathStr,true); + _key?.DeleteValue(path.Key,false); } catch (Exception ex) { @@ -192,8 +192,8 @@ namespace cmonitor.client.reports.system } try { - RegistryKey _key = Registry.CurrentUser.OpenSubKey(delPathStr); - _key?.DeleteValue(path.Key); + RegistryKey _key = Registry.CurrentUser.OpenSubKey(delPathStr,true); + _key?.DeleteValue(path.Key,false); } catch (Exception ex) {