草庐IT

profileInfo

全部标签

c# - 编辑其他用户的注册表项

如何更改或编辑当前用户以外的其他用户的注册表值?我知道其他用户的凭据。 最佳答案 您可以模拟用户,然后更改当前上下文的注册表。以下是一些关于C#和模拟的资源:WindowsImpersonationusingC#WindowsImpersonationfromC#你想要做的是这样的(伪):using(varimpersonation=newImpersonate(username,password)){ChangeRegistry(keys,values);}并且当模拟被处理掉时,您将再次使用正在运行的用户。Hereisanexam