RegistrySecurity Access is denied. C#
问题 I'm currently having an issue when writing an app to set permissions on some Legacy keys. Legacy keys are quite locked down and to actually modify them in regedit you have to take ownership and then add yourself with full control. When trying to replicate this in code i cannot get the key for write with the error "Access is denied". Example code: RegistrySecurity rs = new RegistrySecurity(); rs.AddAccessRule(new RegistryAccessRule("Administrators", RegistryRights.FullControl,