如果将requestExecutionLevel设置为"requireAdministrator",则Windows 8 Winform将不会自动启动. [英] windows 8 winform won't autostart when requestedExecutionLevel set to "requireAdministrator"

查看:695
本文介绍了如果将requestExecutionLevel设置为"requireAdministrator",则Windows 8 Winform将不会自动启动.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个winform应用程序.

i created a winform application.

我的程序需要管理员权限才能正常工作, 因此我添加了具有以下特权的 app.manifest 文件:

my program needs administrator permissions to work, so i added app.manifest file with the following privileges:

<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
    <requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
</requestedPrivileges>

我将该程序添加到Windows 8自动启动中,因此它应该自动启动. 当我将app.manifest更改为以下行时,它将在Windows启动时成功加载.

i added the program to the windows 8 autostart so it should autostart. when i change the app.manifest to the following line, it loads successfully at start of windows.

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

我如何在Windows中启动程序并仍然保持其管理员权限?

how can i start my program with windows and still keep its administrator permission?

谢谢, shlomi

thanks, shlomi

推荐答案

将需要高特权的功能分开并将其放入Windows Service(默认情况下,您可以设置服务器启动时使用的帐户或SYSTEM帐户) .或使用预定任务启动应用程序(在这里您还可以选择运行应用程序的帐户/特权)

Either separate the functionality that needs high privileges and put it in a Windows Service (you can set the account under which the server starts or the SYSTEM account by default). OR start your application using scheduled tasks (here you can also choose the account/privileges under which your application runs)

这篇关于如果将requestExecutionLevel设置为"requireAdministrator",则Windows 8 Winform将不会自动启动.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆