使用 Process.Start 和 UAC 在 .NET 中模拟

发布于 2024-09-26 19:09:36 字数 165 浏览 0 评论 0原文

我正在尝试从另一个 .NET 程序运行程序,该程序需要使用 Process.Start (System.Diagnostics) 方法的模拟选项进行提升。用于模拟的用户是本地管理员。操作系统是2008年,UAC已开启。 每当调用进程启动时,我都会收到 Win32 权限错误:

“请求的操作需要提升”

I am trying to run programs from another .NET program that requires elevation using the impersonation option of the Process.Start (System.Diagnostics) method. The user for impersonation is a local administrator. The O/S is 2008 and UAC is turned on.
Whenever calling process start I'm getting a Win32 permission error:

"The requested operation requires elevation"

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

银河中√捞星星 2024-10-03 19:09:36

如果您调用的 .NET 应用程序在 app.manifest 中配置正确,则无需在 Process.Start 调用中指定任何内容 - UAC 将自动显示。

应用程序清单设置:

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

If the .NET application you are calling is configured properly in the app.manifest, you don't have to specify anything in the Process.Start call - the UAC will appear automatically.

app.manifest setting:

<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文