我的问题是我的应用程序在将其添加到清单后不再在系统启动时启动
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
</requestedPrivileges>
我知道它与 Windows UAC 有关。但我真的不知道如何在不失去程序启动管理员权限的情况下解决这个问题。
这就是我写入注册表的方式:
if (checkBox13.Checked)
{
File.WriteAllText(@"C:\ProgramData\Programname\autorunstate", "true");
RegistryKey rk = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);
rk.SetValue("Programname", Application.ExecutablePath.ToString());
}
如果有人能告诉我如何让程序现在在系统启动时启动会很好吗?在我将此行添加到清单之前它起作用了。谢谢你。