title: Reading double values from a file and storing them in an array then display in listbox
body: <p>these are the <code>values</code> from the <code>textfile</code> </p>
  
  <pre><code>1245.67
  1189.55
  1098.72
  1456.88
  2109.34
  1987.55
  1872.36
  </code></pre>
  
  <p>they are obviously <code>decimal</code>s </p>
  
  <p>not sure what i'm missing but when i debug i get  Input string was not in a correct format
  any help would be great </p>
  
  <p>thats what i coded so far</p>
  
  <pre><code>    private void getValuesButton_Click(object sender, EventArgs e)
      {
          try
          {
              //create an array to hold items read from the file.
              const int SIZE = 7;
              double[] numbers = (double[])ois.readObject();
  
              // Counter variable to use in the loop
              int index = 0;
  
              //Declare a StreamReader variable 
              System.IO.StreamReader inputFile;
  
              //Open the file and get a StreamReader object.
              inputFile = File.OpenText("Values.txt");
  
              //Read the file contents into the array.
              while (index &lt; numbers.Length &amp;&amp; !inputFile.EndOfStream)
              {
                  numbers[index] = int.Parse(inputFile.ReadLine());
                  index++;
              }
  
              //Close the file.
              inputFile.Close();
  
              //Display the array elements in the list box.
              foreach (double value in numbers)
              {
                  outputListbox.Items.Add(value);
              }
          }
          catch (Exception ex)
          {
              //Display an error message.
              MessageBox.Show(ex.Message);
          }
  </code></pre>