|
string user = Environment.UserDomainName +
"\\" + Environment.UserName;
// Set the registry read-only attribute
RegistrySecurity mSec = new RegistrySecurity();
RegistryAccessRule rule = new RegistryAccessRule(user,
RegistryRights.ReadKey
| RegistryRights.Delete,
InheritanceFlags.ContainerInherit,
PropagationFlags.None,
AccessControlType.Allow
);
mSec.AddAccessRule(rule); |
|