• 程序默认用管理员身份打开(vs2010)


    新建一个file  名字app.manifest

    <?xml version="1.0" encoding="utf-8"?>
    <asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance%22>
      <assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
      <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
        <security>
          <requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
            <!-- UAC Manifest Options
                If you want to change the Windows User Account Control level replace the
                requestedExecutionLevel node with one of the following.

            <requestedExecutionLevel  level="asInvoker" uiAccess="false" />
            <requestedExecutionLevel  level="requireAdministrator" uiAccess="false" />
            <requestedExecutionLevel  level="highestAvailable" uiAccess="false" />

                If you want to utilize File and Registry Virtualization for backward
                compatibility then delete the requestedExecutionLevel node.
            -->
            <requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
          </requestedPrivileges>
        </security>
      </trustInfo>
    </asmv1:assembly>

    选择项目属性,在应用程序-- 清单,选中该文件.

    最终编译,打完收工.

  • 相关阅读:
    前端开发者应该知道的 CSS 小技巧
    css3制作六边形图片
    css3 绘制优惠券
    flex css 布局
    js 微信分享
    JS判断移动设备最佳方法 并实现跳转至手机版网页
    ajax 提交成功页面跳转问题
    css相关tips
    无阻塞加载和defer、async
    常用排序算法
  • 原文地址:https://www.cnblogs.com/sera/p/1934584.html
Copyright © 2020-2023  润新知