title: Add registry key through code
body: <p>I'm trying to add a <code>registry key</code> through my code on the startup of the program. I'm completely new to this and I don't know how to (and couldn't search for) but I have tried with this code:</p>
  
  <pre><code>RegistryKey HTML5Key = Registry.LocalMachine.OpenSubKey("HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Internet Explorer\\MAIN\\FeatureControl\\FEATURE_BROWSER_EMULATION", true);
  
  if (HTML5Key != null)
  {
      HTML5Key.SetValue("mybrowser.exe", "270f", RegistryValueKind.DWord);
      HTML5Key.Close();
  }
  </code></pre>
  
  <p>But it simply does nothing. What am I doing wrong? I have admin rights. I have tried to debug it but I can't even get inside the <code>if bracket</code>.</p>