以标准用户身份登录时如何写入注册表 [英] How to write in to registry when logged in as Standard User

查看:364
本文介绍了以标准用户身份登录时如何写入注册表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



我开发了一个MFC应用程序来写入注册表以禁用几个应用程序。当我登录管理系统时它工作正常。但是当我以标准用户身份登录系统时失败。



我甚至在我的visual studio项目属性中将UAC执行级别更改为requireAdministrator。但仍然是iam面对同样的问题。任何人都可以帮我解决这个问题。



先谢谢你。

解决方案

< blockquote>除非您提供凭据或实际以管理员身份登录,否则该帐户无权编写这些注册表项。



您可以在自己的程序中表示您需要写入限制区域,向用户询问一些凭据,从您的应用程序登录并模拟该用户,写入注册表,然后恢复原始自我。



否则,您可以查看r注册表打开错误被拒绝访问并且礼貌地告诉用户他们必须是管理员才能在你的程序中执行这样的功能。



这就是为什么它是称为安全 - 未经许可的用户帐户不写在那里。


Hello,

I have developed an MFC application to write in to the registry to disable few applications.It works fine when i logged in to a administrative system.But fails when i logged in to the system as a Standard user.

I even have changed the UAC Execution Level to requireAdministrator in my visual studio project properties.But still iam facing the same issue.Kindly can any one help me to solve this.

Thanks in Advance.

解决方案

Unless you provided credentials or are actually logged in as an adminsitrator, then the account does not have permission to write those registry keys.

You can in your own program indicate that you need to write to a restricted area, ask the user for some credentials, login from your application and impersonate that user, write to registry, and then revert back to original self.

Otherwise, you can check for the registry open error to be access denied and politely tell user they must be an adminsitator to perform such funtion from within your program.

That''s why it is called security - user accounts without permission don''t write there.


这篇关于以标准用户身份登录时如何写入注册表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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