From 6288de4dfd99a45663e9a27c3c156834ee7b7b78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=93=9D=E7=82=B9lilac?= Date: Sat, 26 Dec 2020 12:34:34 +0800 Subject: [PATCH] --- .../BulePointLilac.Methods/RegTrustedInstaller.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ContextMenuManager/BulePointLilac.Methods/RegTrustedInstaller.cs b/ContextMenuManager/BulePointLilac.Methods/RegTrustedInstaller.cs index 3a44128..f72129b 100644 --- a/ContextMenuManager/BulePointLilac.Methods/RegTrustedInstaller.cs +++ b/ContextMenuManager/BulePointLilac.Methods/RegTrustedInstaller.cs @@ -154,7 +154,7 @@ namespace BulePointLilac.Methods WindowsIdentity id = null; //利用试错判断是否有写入权限 try { key = RegistryEx.GetRegistryKey(regPath, true); } - catch(Exception) + catch { try { @@ -204,7 +204,7 @@ namespace BulePointLilac.Methods ///不过我发现经过上面的操作,虽然无法还原所有者权限,但是已经获取了注册表权限 ///即已经将TrustedInstaller权限更改为当前管理员用户权限,我要的目的已经达到了 } - catch(Exception) { } + catch { } } finally { key?.Close(); id?.Dispose(); } }