在工作過程中,我可能可能遇到要求編譯好的程序默認以管理員權限運行,我們可以這樣操作
一、新建一個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="nim_demo.exe.manifest" type="win32" /> <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3"> <security> <requestedPrivileges> <requestedExecutionLevel level="requireAdministrator" uiAccess="false"/> <!--<requestedExecutionLevel level="asInvoke" uiAccess="false"/>--> </requestedPrivileges> </security> </trustInfo> </assembly>
命名為:appXXX.exe.manifest(appXXX為你的程序)
並將它放到你的bin文佳目錄下
二、依次為:

$(IntDir)$(TargetName)$(TargetExt).intermediate.manifest
是
ResuestAdmin....
三、將第一步的文件以資源方式引入程序
