天天看点

【转载】WPF 添加Adminstrator管理员权限,默认以管理员身份运行!!!【转载】原文:https://www.cnblogs.com/zhangzhi19861216/p/3955740.htmlWPF 添加Adminstrator 权限

【转载】原文:https://www.cnblogs.com/zhangzhi19861216/p/3955740.html

WPF 添加Adminstrator 权限

在WPF应用开发中,需要WPF操作后台注册的Windows Service,可是WIX打包的安装程序不具备赋予WPF App默认管理员权限。

因此,需要我们手工在WPF项目中添加管理员权限:

1、右击项目->Properpies->Security->Enable ClickOnce security setting,

     你将看到项目属性目录下出现app.manifest文件

【转载】WPF 添加Adminstrator管理员权限,默认以管理员身份运行!!!【转载】原文:https://www.cnblogs.com/zhangzhi19861216/p/3955740.htmlWPF 添加Adminstrator 权限
【转载】WPF 添加Adminstrator管理员权限,默认以管理员身份运行!!!【转载】原文:https://www.cnblogs.com/zhangzhi19861216/p/3955740.htmlWPF 添加Adminstrator 权限

2、修改修改节点<requestedExecutionLevel  level="asInvoker" uiAccess="false" />

     为

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

【转载】WPF 添加Adminstrator管理员权限,默认以管理员身份运行!!!【转载】原文:https://www.cnblogs.com/zhangzhi19861216/p/3955740.htmlWPF 添加Adminstrator 权限

3、去掉Enable ClickOnce security setting选项

【转载】WPF 添加Adminstrator管理员权限,默认以管理员身份运行!!!【转载】原文:https://www.cnblogs.com/zhangzhi19861216/p/3955740.htmlWPF 添加Adminstrator 权限

好了。

继续阅读