我有一个应用程序,该应用程序通常可以以当前的非管理员用户身份运行,但是该应用程序的某些功能(通过单击按钮由用户激活)需要具有管理员权限才能工作.当用户尝试使用这些特权功能时,我希望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[^]
更多推荐
应用程序中的部分管理权限
发布评论