首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

请问关于vs2005 写的程序在win7上运行时的管理员权限有关问题

2012-04-28 
请教关于vs2005 写的程序在win7上运行时的管理员权限问题用vs 2005写的一个Windows程序。在winxp上一直都正

请教关于vs2005 写的程序在win7上运行时的管理员权限问题
用vs 2005写的一个Windows程序。
在winxp上一直都正常,但是在win7上就不行。后来发现在win7右键以管理员权限运行就没有问题。

请问一下,怎么能通过修改程序或者修改配置文件来解决这个问题而不需要每次以管理员权限运行。

[解决办法]
直接想绕过UAC,不太好办,可以给你的exe配个manifest文件
比如你的程序名称是 MyApp.exe, 复制以下xml,在相同目录下生成一个MyApp.exe.manifest文件

XML code
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">  <assemblyIdentity version="1.0.0.0"  processorArchitecture="X86"  name="MyApp"  type="win32" />  <description>MyApp for UAC support</description>  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">    <security>      <requestedPrivileges>        <requestedExecutionLevel level="requireAdministrator" />      </requestedPrivileges>    </security>  </trustInfo></assembly> 

热点排行