zoukankan      html  css  js  c++  java
  • 在Vista操作系统中通过manifest文件使VC应用程序获得管理员权限

    原文

    VC编译出来的应用程序在vista下运行,有可能因为权限问题,不能成功运行。

    用以下办法,给应用程序添加一个manifest文件,程序运行时系统就会跳出UAC对话框,获得管理权限。

    1.打开应用程序的源代码工程

    2.添加一个“custom”资源,"resource type"填24,把资源ID改为1,然后把以下内容复制到资源内容中保存

     <?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> 

    3.重新编译应用程序,此时会发现,广用程序的图标在vista下会多出一个小盾标志。

  • 相关阅读:
    什么是web框架
    编写CGI程序步骤
    web开发 c/s结构 和 b/s结构
    python自带的web服务器
    自制计算器
    条件判断
    模版继承
    参数传递
    异常处理
    【uoj#244】[UER #7]短路 CDQ分治+斜率优化dp
  • 原文地址:https://www.cnblogs.com/hei-hei-hei/p/7908574.html
Copyright © 2011-2022 走看看