Why do I get 3 values inserted into my C# combo box instead of just 1?
<p>When reading the registry for file names I get 3 entries loading into my combo box for every 1 registry entry. If I have 1 file listed in the registry I would see :</p>

<p>Combo box values:</p>

<p>c:\file1.txt</p>

<p>&lt;-----Blank here</p>

<p>c:\file1.txt</p>

<p>I have found the problem lies in this code, it hits 'if (previousFiles != null)' 3 times. How should I correct this?</p>

<pre><code>for (int i = 0; i &lt;= 5; i++)
     {
      Object previousFiles = OurKey.GetValue("Files" + i);
        if (previousFiles != null)
         {
                    comboBox1.Items.Add(previousFiles.ToString());
          }
     }
</code></pre>

<p>Many thanks
Monday morning blues!</p>
