`
happmaoo
  • 浏览: 4341035 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

使用manifest解决UAC问题

阅读更多

VS2008前的版本需要添加一个manifest文件,内容如下:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
version="1.0.0.0"
processorArchitecture
="X86"
name
="mulitray.exe.manifest"
type
="win32"
/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="requireAdministrator" uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>

保存为UAC.manifest,在rc文件中添加以下内容

1 24 "UAC.manifest"

(VS2005可能会报错,在rc上清除以上代码,使用项目属性添加的方法项目属性->manifest tool->input and output)

VS2008中就相对简单的多了,只需要动手选择一下就行,项目属性->配置属性->连接器->manifest file : 将UAC Execution Level勾选为requireAdministrator

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics