title: c# Threadpool - limit number of threads
body: <p>I am developing a console app.</p>
  
  <p>I want to use a Threadpool to perform web downloads. Here is some fake code. </p>
  
  <pre><code> for (int loop=0; loop&lt; 100; loop++)
   {
       ThreadPool.QueueUserWorkItem(new WaitCallback(GetPage), pageList[loop]);
   }
  
  
  snip
  
  private static void GetPage(object o)
  {
      //get the page
  }
  </code></pre>
  
  <p>How do I prevent my code from starting more than two (or ten, or whatever) simultaneous threads?</p>
  
  <p>I have tried </p>
  
  <pre><code>    ThreadPool.SetMaxThreads(1, 0);
      ThreadPool.SetMinThreads(1, 0);
  </code></pre>
  
  <p>But they seem to have no impact.</p>