Iterating over unknown data structure?
<p><b>Duplicate</b>: <a href="http://stackoverflow.com/questions/420275/">http://stackoverflow.com/questions/420275/</a></p>

<p><hr /></p>

<p>When I run the following code:</p>

<pre><code>    foreach (object bar in list)
    {
        Console.WriteLine = bar;
    }
</code></pre>

<p>I get the following output:</p>

<blockquote>
  <p>System.Collections.DictionaryEntry</p>
  
  <p>System.Collections.DictionaryEntry</p>
  
  <p>System.Collections.DictionaryEntry</p>
  
  <p>System.Collections.DictionaryEntry</p>
  
  <p>System.Collections.DictionaryEntry</p>
  
  <p>System.Collections.DictionaryEntry</p>
  
  <p>System.Collections.DictionaryEntry</p>
</blockquote>

<p>But how do I write out the contents of each line above?</p>
