110,539
社区成员
发帖
与我相关
我的任务
分享
RegistrySecurity rsy = new RegistrySecurity();
RegistryAccessRule rar = new RegistryAccessRule(Environment.UserDomainName +
"\\" + Environment.UserName, RegistryRights.ReadKey | RegistryRights.WriteKey |
RegistryRights.Delete, InheritanceFlags.ContainerInherit, PropagationFlags.None,
AccessControlType.Allow);
rsy.AddAccessRule(rar);
Microsoft.Win32.RegistryKey rootKey = Microsoft.Win32.Registry.LocalMachine;//本地计算机数据的配置
Microsoft.Win32.RegistryKey runKey = rootKey.CreateSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Run", RegistryKeyPermissionCheck.ReadWriteSubTree,rsy);