title: Argument Out of range Exception when insert element into list
body: <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Diagnostics;
  
  namespace ConsoleApplication1
  {
      class Program
      {
          static void Main(string[] args)
  
  
  {
      List&lt;string&gt; ul = new List&lt;string&gt;();
      Process[] procs = Process.GetProcesses();
      int u = 0;
  
      foreach (Process proc in procs)
      {
          ul[u] = proc.ProcessName;
          u++;
      }
  
  }
  }
  }
  </code></pre>
  
  <p>I want to move each process name into my arraylist each time loop executed but i'm getting outofbound Exception. please provide some sample codes. thanks in advance...</p>