title: Return array values into listbox (C#)
body: <p>I have an array that gets its values from a text file. Each line is an array value. I am trying to make each of those array values go into the listbox. Such as</p>
  
  <pre><code>[0] - Hello
  [1] - Goodbye
  </code></pre>
  
  <p>and in the listbox, the first option will be hello, and the second will be goodbye etc.</p>
  
  <p>The text file is Hello and Goodbye on seperated lines</p>
  
  <p>Heres my code to sort the array from the text file:</p>
  
  <pre><code>StreamReader sr = new StreamReader("text.txt");
  int counter = 0;
  string line;
  string[] linea;
  linea = new string[100];
  while ((line = sr.ReadLine()) != null)
  {
      linea[counter] = line;
      counter++;
  }
  sr.Close();
  </code></pre>
  
  <p>And here's my code for the list box:</p>
  
  <pre><code>this.listBox1.Items.AddRange(new object[] {
  // Values go here
  // i want the arrays here, so that its like "hello", "goodbye",
  });
  </code></pre>
  
  <p>Help is much appreciated.
  I am using MS Visual Studio 2010.</p>