vs2005和vs2010 UAC提权



UAC是什么意思,看官方解释:

User Account Control (UAC) is a new security component in Windows Vista and newer operating systems. With UAC fully enabled, interactive administrators normally run with least user privileges. This article and the attached code samples demonstrate these frequently asked coding scenarios related to UAC.


简单来说就是给当前应用程序提供权限,进而可以对系统做一些需要特殊权限才能完成的操作,比如联网,写文件等。


在VS2010下UAC提权非常简单,只需要在编译器内工程属性设置即可,如下图:


但vs2005就没有这么简单了,但也是比较方便的,方法如下:

首先新建一个xml文件,输入以下下内容:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="requireAdministrator"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>

然后将这个文件拖拽到vs2005的工程目录下,通过菜单添加因为有file filter,似乎添加不了。

然后重命名下文件为 uac.manifest,重新编译即可



更多内容,请参考 www.seanyxie.com

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值