uac - 启动应用程序时显示 UAC 提示

标签 uac windows-vista

我有一个应用程序需要管理员权限才能执行某些操作。我只想在启动时显示 UAC 提示,然后提升。我不确定该怎么做,但我听说过诸如 list 之类的东西,但在任何地方都看不到明确的答案。

最佳答案

您需要一个需要提升权限的应用程序 list 。这是回答这个问题的博客中的引述:

First, you can create a manifest file by adding an “Application Manifest File” Item to your project (default name: app.manifest), then you can set it through the Application Tab in the Project Properties. If you want to change the Windows User Account Control level in your manifest file, all you need is to set the value of the level attribute of the requestedExecutionLevel node with one of the following:

  • asInvoker (default): the application will run using the current Windows user provileges
  • requireAdministrator: the application requires an Administrator user
  • highestAvailable: highest privileges for the current user will be used

http://dariosantarelli.wordpress.com/2007/11/21/vs2008-embedding-uac-manifest-options/

关于uac - 启动应用程序时显示 UAC 提示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1215443/

相关文章:

c# - 有时以管理员身份运行

windows - 禁用 UAC 虚拟化后恢复文件

winapi - 如何(以编程方式)获取 Windows UAC 虚拟化文件的位置?

windows-7 - 如何编程引导加载程序..?想要一个装有 Windows 7、XP、Vista 和 98 SE 的 USB 闪存驱动器用于安装

windows-vista - Windows Vista 中 %allusersprofile% 文件夹的位置?

c# - TextRenderer.DrawText 在 XP 和 Vista 上以不同方式呈现 Arial

windows - 类未注册 HRESULT 0x80040154

windows-7 - 如何实现自定义 UAC 权限 UI?

windows - 以某种方式能够在 Windows 8 中启用 UAC 的情况下写入 ProgramData

powershell - 用于重置网络适配器的命令/Powershell 脚本