在运行时请求管理员特权 [英] Requesting Administrator privileges during runtime

查看:134
本文介绍了在运行时请求管理员特权的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在运行时请求管理员特权,以便提示用户允许或禁止它?

How do I request Administrator privileges during runtime so the user is given the prompt to allow or disallow it?

推荐答案

此信息写在exe文件清单中.您必须使用requestedExecutionLevel字段(但不确定如何-尝试将其设置为highestAvailable并查看它是否满足您的要求).例如,在这里看到更多信息(有些旧文章但仍然有效):

This information is written in the exe file manifest. You must use the requestedExecutionLevel field (but not sure about that - try setting it to highestAvailable and see if it does what you need). See for example here for more information (somewhat older article but still valid): http://blogs.msdn.com/b/cjacks/archive/2006/09/08/exploring-manifests-part-2-default-namespaces-and-uac-manifests-in-windows-vista.aspx

Visual Studio中有一些工具,可让您嵌入自己的清单或什至只是对其进行编辑.还有一个用Perl编写的工具( http://metacpan.org/pod/Win32 :: Exe :: Manifest ).

There are tools in Visual Studio which allow you to embed your own manifest or even just edit it. Also there is a tool written in Perl ( http://metacpan.org/pod/Win32::Exe::Manifest ).

有关更多信息,请参见此文章:

see this article for more info: http://www.codeproject.com/Articles/66259/Requesting-Admin-Approval-at-Application-Start.aspx

这篇关于在运行时请求管理员特权的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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