So I am trying to create a Windows Form program. The program is supposed to use a menustrip to open a handful of various text files containing lines of text for a student name, class, and a series of grades. The program then adds the name/class to labels on the form, and adds the grades to an array which is then used to calculate a final score. I managed to get the program to let me open the text file. I was then able to put all the information into a richtextbox.

However, now I am trying to parse out the lines and make use of them. I'm trying to divide the lines up into variables and split them where there is a comma.

I tried using the string[] textSplit = OpenFile.Split(","); but I get an error.

How can I split up the pieces of text and then how can I actually interact with each line? What should I be doing next? I'm so lost.

```
   private void openToolStripMenuItem_Click(object sender, EventArgs e)
    {
        OpenFileDialog openFileDialog1 = new OpenFileDialog
        {
            InitialDirectory = @"",
            Title = "Browse Text Files",

            CheckFileExists = true,
            CheckPathExists = true,

            DefaultExt = "txt",
            Filter = "txt files (*.txt)|*.txt",
            FilterIndex = 2,
            RestoreDirectory = true,

            ReadOnlyChecked = true,
            ShowReadOnly = true
        };

        if (openFileDialog1.ShowDialog() == DialogResult.OK)
        {

        }

        var OpenFile = new System.IO.StreamReader(openFileDialog1.FileName);
        richTextBox1.Text = OpenFile.ReadToEnd();
        string[] textSplit = OpenFile.Split(",");

    }

```