| |

VerySource

 Forgot password?
 Register
Search
View: 534|Reply: 1

How to control registry node permissions

[Copy link]

5

Threads

5

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 Unknown

Post time: 2020-3-11 12:00:02
| Show all posts |Read mode
As above
Reply

Use magic Report

0

Threads

7

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-6-4 09:00:01
| Show all posts
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);
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list