为注册表项添加新用户 [英] Adding new user for Registry key

查看:276
本文介绍了为注册表项添加新用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于注册表项,我们可以右键单击特定项并选择权限选项,然后单击添加"按钮来添加新用户.
请问可以通过vb.net代码执行上述操作吗?请帮助..

For a registry key we can right click on particular key and selecting permissions option and adding new user by clicking on Add button.
Is it possible to do above things through vb.net code?Pls help..

推荐答案

是的.只要您以管理员身份运行,就很有可能添加注册表项.
经历
使用VB.NET使用Windows Registry [ ^ ]
http://omarabid.hubpages.com/hub/Using-Registry-Keys-with-VBnet [ ^ ]
http://www.dreamincode.net/forums/topic /176326-add-a-value-to-a-registry-key/ [此处 [ ^ ]是视频.
Yes. So long as you are running as an admin, its quite possible to add registry keys.
Go through
Working with Windows Registry using VB.NET[^]
http://omarabid.hubpages.com/hub/Using-Registry-Keys-with-VBnet[^]
http://www.dreamincode.net/forums/topic/176326-add-a-value-to-a-registry-key/[^]

Here[^] is a video.


问题尚不清楚-请参阅我对问题的评论.

如果您要创建一个新的用户帐户,我只想告诉您一件事:严格来说,您不能通过至少一个简单的原因来做到这一点:添加帐户并不只是向注册表添加一些密钥和其他数据.解释如下:
http://en.wikipedia.org/wiki/Windows_Registry [ http://support.microsoft.com/default.aspx?scid=kb;zh-我们; 306273 [ ^ ].

另请参阅此讨论:
http://stackoverflow. com/questions/5984600/how-to-programmatically-create-windows-user-accounts-on-windows-7-or-windows-ser [ ^ ].

—SA
The question is not clear — please see my comment to the question.

In case you want to create a new user account, I want to tell you just one thing: strictly speaking, you cannot do it by at least one simple reason: adding an account is not just adding some keys and other data to the Registry. This is explained here:
http://en.wikipedia.org/wiki/Windows_Registry[^].

Please pay attention that there are separate registry files for each user, NTUSER.DAT and USRCLASS.DAT, so you would need to create them, among other things. As before the files are created and before the newly created user is not logged on the usual .NET interface of Microsoft.Win32.Registry could not be applied to those files, you would need to create them on lower level. I am not sure if this is even documented.

Nevertheless, adding a new user account using .MET is possible, but is has nothing to do with (direct) Registry manipulations.

This is the Microsoft article explaining how to add a new user programmatically using Directory Services:
http://support.microsoft.com/default.aspx?scid=kb;en-us;306273[^].

See also this discussion:
http://stackoverflow.com/questions/5984600/how-to-programmatically-create-windows-user-accounts-on-windows-7-or-windows-ser[^].

—SA


这篇关于为注册表项添加新用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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