zoukankan      html  css  js  c++  java
  • C# 程序获取管理员方法

    1:项目=>属性=>应用程序=>图标和清单=>清单 选【app.manifest】

    2:设置uac 选项
    <?xml version="1.0" encoding=Mutf-8"?>
    <assembly manifestVension="l.0" xmlns=Murn:schemas-microsoft-com:asm.vl">
    <assemblyldentity version="1.0.0.0" name="MyApplication.app"/>
    <trustInfo xmlns=Murn:schemas-microsoft-com:asm.v2">
    <secunity>
    <requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
    <!-- UAC清单选项
    如果想要更改Windows用户帐户控制级SU ,请使用
    以下节点之—替换requestedExecutionLevel节点。n
    <requestedExecutionLevel level="asInvoker" uiAccess="false" />
    <requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
    <requestedExecutionLevel level="highestAvailable" uiAccess="false" />
    指定requestedExecutionLevel元素将禁用文件和注册表虚拟化。
    如果你的应用程序需要此虚拟化来实现向后兼容性,则删除此
    元素。
    -->
    <requestedExecutionLevel leve="requireAdministrator" uiAccess="false" />
    </requestedPrivileges>
    </security>
    </trustInfo>
    </assembly>

  • 相关阅读:
    Linux环境变量$PATH
    grep
    echo命令
    ip命令
    浅析Linux下的/etc/profile、/etc/bashrc、~/.bash_profile、~/.bashrc文件
    shell脚本4种执行方式
    /proc路径
    tr命令
    Linux命令cut
    前端论坛网站知识
  • 原文地址:https://www.cnblogs.com/wa502/p/11603357.html
Copyright © 2011-2022 走看看