title: Cannot copy Dictionary 'Value' to a List - C#
body: <p>Having followed a tutorial I have a hashtable that contains a TcpClient object that matches with the string of a connected user. After reading about the pro's and cons of a hashtable it was recommended that using a Dictionary is preferred due to it being generic, thus more flexible.</p>
  
  <p>From here an array is made that contains the Values from the hashtable, in this case the TcpClient of the users. By looping the array of TcpClients I can get the stream of each user and write a message to their screen.</p>
  
  <p>Now if I try and convert the array holding the TcpClient object for each user I get the following errors:</p>
  
  <p><strong>The best overloaded method match for 'System.Collections.Generic.Dictionary.ValueCollection.CopyTo(System.Net.Sockets.TcpClient[], int)' has some invalid arguments</strong></p>
  
  <p><strong>Argument 1: cannot convert from 'System.Collections.Generic.List' to 'System.Net.Sockets.TcpClient[]'</strong> </p>
  
  <p>This is the Dictionary object:</p>
  
  <pre><code>public static Dictionary&lt;string, TcpClient&gt; htUsers = new Dictionary&lt;string, TcpClient&gt;();
  </code></pre>
  
  <p>This is the List I create:</p>
  
  <pre><code>List&lt;TcpClient&gt; tcpClients = new List&lt;TcpClient&gt;(); 
  </code></pre>
  
  <p>This is the method I'm trying to follow to copy the Values to the List:</p>
  
  <pre><code>htUsers.Values.CopyTo(tcpClients,0);
  </code></pre>
  
  <p>Is it something that can't be done or do I need to make a simple change?</p>
  
  <p>Thanks for your time.</p>