在C#.NET应用程序中是否可以在Windows 7 PC上请求管理权限?
我希望能够通过Click Once部署应用程序并让用户使用它来执行管理任务(在这种情况下,它正在编写主应用程序的注册表项。)
答案 0 :(得分:15)
http://victorhurdugaci.com/using-uac-with-c-part-1
http://victorhurdugaci.com/using-uac-with-c-part-2
http://victorhurdugaci.com/using-uac-with-c-part-3
*自我推销
额外字符,因为它必须是30
答案 1 :(得分:7)
您需要做的就是添加清单应用程序文件 到你的项目
简单:右键单击项目,添加,新项目,清单文件
并更改
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
到
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />