title: Programmatically assign the permission to a registry subkey
body: <p>Here is how we <code>manually</code> assign the permissions to a registry key:</p>
  
  <p><strong>To assign permissions to a registry key</strong></p>
  
  <ul>
  <li><p>Open Registry Editor. Click the key to which you want to assign permissions.</p></li>
  <li><p>On the Edit menu, click Permissions.</p></li>
  <li><p>Assign an access level to the selected key as follows: </p></li>
  <li><p>To grant the user permission to read the key contents, but not save
  any changes made to the file, under Permissions for name, for <strong>Read</strong>,
  select the Allow check box.</p></li>
  <li><p>To grant the user permission to open, edit, and take ownership of the
  selected key, under Permissions for name, for <strong>Full Control</strong>, select
  the Allow check box.</p></li>
  <li><p>To grant the user special permission in the selected key, click
  Advanced.</p></li>
  </ul>
  
  <p>So my question is, would it be possible to do it programmatically? Say, if I want to grant Users <strong>full control</strong> permission on a particular subkey, how should I write the code in C#? Thanks very much.</p>