title: Read multiple lines from textfile into array
body: <p>I'm working on a small program which holds information about people. The information is stored in a textfile as a sentence and the words are separated by ";". I know how to read the lines with a streamreader, I do this upon clicking on a button.
  I then split the sentence in words and save them in an array.
  When clicking a second button I want the separate words displayed in different textboxes (their name, birth date, etc.). And every time you click the button the info of the next person is being displayed until the whole list is displayed.</p>
  
  <p>The problem I encounter is that only the last value of my array is displayed in the textboxes. I understand that every time I loop over the readline(), the array is being filled with strings and overwritten. I don't want to use a list for now as I already found an answer with lists. I just can't find a way to save or so my information in the array and display it later on.</p>
  
  <p>I'll put my code here:</p>
  
  <pre><code>string[] words = new string[10];
  
  private void btnInput_Click(object sender, EventArgs e)
  {
      string line = "";
      try
      {
          StreamReader file = new StreamReader("pers.txt");
  
          while (file.Peek() != -1)
          {       
              line = file.ReadLine();   
              words = line.Split(';');              
          }
          file.Close();
  
          MessageBox.Show("File read", "Info");
      }
      catch (FileNotFoundException ex)
      {
          MessageBox.Show(ex.Message, "File not found");
          return;
      }
  }
  
  private void btnOutput_Click(object sender, EventArgs e)
  {
      txtName.Text = words[0];
      txtdate.Text = words[1];
      txtNr.Text = words[2];
      txtStreet.Text = words[3];
      txtPost.Text = words[4];
      txtCity.Text = words[5];
  
      MessageBox.Show("All persons showed", "Info");
  }
  </code></pre>