UAC

用户帐户控制(UAC)是微软在Windows Vista及后续操作系统中引入的安全技术,旨在通过限制应用程序权限来提高系统安全性。即使用户拥有管理员权限,运行的应用程序也必须获得明确授权才能提升权限。当应用程序请求提升权限时,会显示带有安全性盾牌图标的UAC提示。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

UAC and Security Shield Icon

UAC in Wiki

User Account Control (UAC) is a technology and security infrastructure introduced with Microsoft’s Windows Vista and Windows Server 2008 operating systems.
It aims to improve the security of Microsoft Windows by limiting application software to standard user privileges until an administrator authorizes an increase or elevation.
In this way, only applications trusted by the user may receive administrative privileges, and malware should be kept from compromising the operating system.

In other words, a user account may have administrator privileges assigned to it,
but applications that the user runs do not inherit those privileges unless they are approved beforehand or the user explicitly authorizes it.

Tasks that require administrator privileges will trigger a UAC prompt (if UAC is enabled);
they are typically marked by a security shield icon

A program can request elevation in a number of different ways.
One way for program developers is to add a requestedPrivileges section to an XML document,
known as the manifest, that is then embedded into the application.

Configure in Visual C++ project

这里写图片描述
The following message cloud be extra from exe using 7-zip:

xxx.exe\.rsrc\MANIFEST\

<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="requireAdministrator" uiAccess="false">
</requestedExecutionLevel>
</requestedPrivileges>
</security>
</trustInfo>
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<ms_windowsSettings:dpiAware xmlns:ms_windowsSettings="http://schemas.microsoft.com/SMI/2005/WindowsSettings" xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</ms_windowsSettings:dpiAware>
</windowsSettings>
</application>
</assembly>

Add manifest file in WPF project

这里写图片描述

Security Shield Icon

When the ‘requestedExecutionLevel’ option select “highestAvailable” or “requireAdministrator” the Security Shield Icon will appear.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值