如何访问HKCU注册表当前登录的用户(S),从服务?注册表、用户、HKCU

由网友(爱你得死撑)分享简介:从内我要检查存储每个用户的HKCU注册表区域内的一些用户preferences一个窗口服务。我怎样才能做到这一点?From within a windows service I want to check some user preferences that are stored within each users'...

从内我要检查存储每个用户的HKCU注册表区域内的一些用户preferences一个窗口服务。我怎样才能做到这一点?

From within a windows service I want to check some user preferences that are stored within each users' HKCU registry area. How can I do this?

我看到HKEY_USERS具有已登录到机器的每个用户的子项(或类似的东西?),并在这些是HKCU区域为每个用户。然而,这些子项是用户的SID,所以某种程度上我需要工作,当前登录的用户(S)出来的SID。

I see that HKEY_USERS has subkeys of each user that has logged in to the machine (or something like that?), and within these are the HKCU areas for each user. However, these subkeys are the SIDs of the users, so somehow I'd need to work out the SID of the currently logged in user(s).

然后,我会查询 HKEY_USERS <保证用户的SID> 取其键 I 需到位查询的 HKEY_CURRENT_USER 为准键 I 需

I would then query HKEY_USERS<the users SID>whicheverkeyineed in place of querying HKEY_CURRENT_USERwhicheverkeyineed.

从this问题我可以得到该机在域用户格式,在当前的用户列表。有没有一种方法来获取用户的SID,从他们的Windows登录?还是有更直接的方式来获得的注册表路径是HKCU为当前登录的用户(S)?

From this question I can get a list of the current users on the machine in DOMAINUSER format. Is there a way to get the SID of a user from their windows login? Or is there a more direct way to get the registry path that is HKCU for the currently logged in user(s)?

推荐答案

下面是转换用户名的SID的一个例子:http://stackoverflow.com/questions/1040623/convert-a-username-to-a-sid-string-in-c-net

Here's an example of converting a username to SID: http://stackoverflow.com/questions/1040623/convert-a-username-to-a-sid-string-in-c-net

阅读全文

相关推荐

最新文章