问题描述
我想将机器的 UAC 级别更改为最高级别的始终通知"级别.
I want to change the UAC level of the machine to "Always Notify" level which is the top level.
我尝试将以下注册表项值更改为 1.Key = HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System
I tried changing the following registry key value to 1.Key = HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System
const string UACkey = @"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System";
const string Subkey = "EnableLUA";
RegistryUtilities.SetValue(UACkey, Subkey, **1**, Microsoft.Win32.RegistryValueKind.DWord, RegistryUtilities.WOW64Key.Key64);
这导致 UAC 处于第 3 级(当程序尝试进行更改时通知).
This result in UAC to be in 3rd level (Notify when programms try to make changes).
如何将其设置为顶级?
推荐答案
我通过更改 UAC 并同时打开 regedit 并观察哪些值发生了变化,设法找到了这一点.
I managed to find this by changing UAC and having regedit open at the same time, and watching which values changed.
在顶部设置时,值
ConsentPromptBehaviorAdmin
更改为 2
,而不是 5
当它在第 3 级时(微软的逻辑很好).更改该值以及 EnableLUA
应该可以做到.
changes to 2
, rather than 5
when it's on the 3rd level (nice logic there Microsoft). Changing that value as well as EnableLUA
should do it.
希望能帮到你
这篇关于C# 将 Windows UAC 级别更改为始终通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!