<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: keys code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Thu, 24 Jul 2008 15:14:48 GMT</pubDate>
    <description>DZone Snippets: keys code</description>
    <item>
      <title>Open/Creates a Base Key in the Registry</title>
      <link>http://snippets.dzone.com/posts/show/4524</link>
      <description>// open a Base Key in the registry&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;       public static RegistryKey GetKey(string baseKey)&lt;br /&gt;        {&lt;br /&gt;            RegistryKey key;&lt;br /&gt;            try&lt;br /&gt;            {&lt;br /&gt;                key = Registry.LocalMachine.OpenSubKey(baseKey, true);&lt;br /&gt;&lt;br /&gt;                if (key == null)&lt;br /&gt;                {&lt;br /&gt;                    key = Registry.LocalMachine.CreateSubKey(baseKey);&lt;br /&gt;                }&lt;br /&gt;                else&lt;br /&gt;                {&lt;br /&gt;                    MessageBox.Show("Base key resolved");&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;            catch (Exception e)&lt;br /&gt;            {&lt;br /&gt;                return null;&lt;br /&gt;            }&lt;br /&gt;            return key;&lt;br /&gt;        }&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Tue, 11 Sep 2007 11:58:28 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/4524</guid>
      <author>dubby (Dave)</author>
    </item>
  </channel>
</rss>
