|
发表于 2020-6-4 09:00:01
|
显示全部楼层
string user = Environment.UserDomainName +
"\\" + Environment.UserName;
// 设置注册表只读属性
RegistrySecurity mSec = new RegistrySecurity();
RegistryAccessRule rule = new RegistryAccessRule(user,
RegistryRights.ReadKey
| RegistryRights.Delete,
InheritanceFlags.ContainerInherit,
PropagationFlags.None,
AccessControlType.Allow
);
mSec.AddAccessRule(rule); |
|