gpt4 book ai didi

c# - 从配置文件强制应用程序到管理员

转载 作者:行者123 更新时间:2023-11-30 22:20:49 25 4
gpt4 key购买 nike

有没有一种方法可以在配置文件中添加设置,以便该应用程序始终以管理员身份启动?非常感谢。

最佳答案

不是来自配置文件,而是来自 .manifest。

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="requireAdministrator" uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>

http://blogs.msdn.com/b/nikhiln/archive/2007/04/19/embed-a-manifest-to-make-an-application-elevate-in-vista.aspx

关于c# - 从配置文件强制应用程序到管理员,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14800089/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com