应用程序中的部分管理权限

编程入门 行业动态 更新时间:2024-10-26 14:34:00
本文介绍了应用程序中的部分管理权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个应用程序,该应用程序通常可以以当前的非管理员用户身份运行,但是该应用程序的某些功能(通过单击按钮由用户激活)需要具有管理员权限才能工作.当用户尝试使用这些特权功能时,我希望UAC弹出,但是我不想以管理员身份运行该应用程序.如果不将特权功能移入其自己的可执行文件中,是否可以实现? 我已经搜索了最后一个小时左右,并且找不到任何不需要以管理员身份运行整个应用程序的内容. 编辑============= 就目前而言,我的解决方案是创建一个单独的控制台应用程序以包含特权代码.这不是我想要的方式,充其量只是一个变通办法. 我想我可以理解如果允许以较高的特权运行程序的某些部分,则可以利用某些深奥的攻击媒介,但这真是不便.我以为他们称这些东西为托管"代码.

I have an app that can mostly run as the current non-admin user, but some features of the app (user-activated by way of a button click) need to have admin privileges to work. I want the UAC to pop up when the user tries to use these privileged features, but I don''t want to have to run the app as admin. Is that possible without moving the privileged features into their own executable? I''ve been googling for the last hour or so, and I can''t find anything that doesn''t require the entire app to be run as admin. EDIT ============= As it stands right now, my solution was to create a separate console application to contain the privileged code. It''s not the way I wanted to do it, and at best it''s merely a work-around. I guess I can understand the possibility of exploiting some esoteric attack vector if running parts of a program with elevated privileges was allowed, but this is damn inconvenient. I thought they called this stuff "managed" code.

推荐答案

这将对您有帮助吗? 在管理任务需要提升高度时,向按钮添加UAC屏蔽 [ ^ ] COM高度(如果可能会有所帮助) msdn.microsoft/en-us/library/ms679687.aspx [ ^ ] stackoverflow/questions/127042/how- to-uac-elevate-a-com-component-with-net [ ^ ] Will this help? Add a UAC shield to a button when elevation is required for admin tasks[^] COM Elevation (in case this may help) msdn.microsoft/en-us/library/ms679687.aspx[^] stackoverflow/questions/127042/how-to-uac-elevate-a-com-component-with-net[^]

更多推荐

应用程序中的部分管理权限

本文发布于:2023-11-11 06:47:43,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1577669.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:应用程序   管理权限

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!