方法一、(http://topic.csdn.net/u/20070303/15/457ee919-8a0b-46c4-9dd7-8606631e2108.html)
在exe的工程中找manifest 中的最後一行之前加下面的代碼:進行編譯就可以了,
<ms_asmv3:trustInfo xmlns:ms_asmv3= "urn:schemas-microsoft-com:asm.v3 "> <ms_asmv3:security xmlns:ms_asmv3= "urn:schemas-microsoft-com:asm.v3 "> <requestedPrivileges> <requestedExecutionLevel level= "requireAdministrator " uiAccess= "false "> </requestedExecutionLevel> </requestedPrivileges> </ms_asmv3:security> </ms_asmv3:trustInfo>