gpt4 book ai didi

c# - 在 C# 中检查用户帐户设置

转载 作者:太空宇宙 更新时间:2023-11-03 11:06:53 24 4
gpt4 key购买 nike

是否可以从 c#/.Net 程序中查看用户帐户控制设置的状态。具体来说,我想知道它是否设置为其中之一

  • 始终通知

  • 从不通知

我不想更改设置,但我想知道它们是什么。 enter image description here

最佳答案

我不确定你能做到。您可以做的是创建和嵌入 list 。

In Windows Vista®, the correct way to mark your applications is to embed an application manifest within your program that tells the operating system what the application needs. In the Windows Vista release, there are provisions to allow non-manifested or unsigned code to run with a full administrative access token.

请看this发布。

根据我的经验,它不仅适用于 Vista,而且适用于 Win7、Win2008。

我们确实尝试使用 manifest,它确实有效。

此外,这可能对您也有帮助:

像这样运行命令以将 list 嵌入到 exe 中:

mt.exe -manifest  "C:\path\to\ypur\manifest\my.manifest" -outputresource:"Path\to\your\exefile\My.exe"

将此命令用于构建后事件:

mt.exe -manifest "$(ProjectDir)$(TargetName).exe.manifest" -updateresource:"$(TargetDir)$(TargetName).exe;"

关于c# - 在 C# 中检查用户帐户设置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15541054/

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