I designed a program that reads a specific line of the text file but I want to
To read 3 lines and put them in the text box, for example, read lines 1, 3 and 5 only from the text file. Thank you
This is the code I want to modify to read more than one line, not a single line
private void Button1_Click(object sender, EventArgs e)
{
openFileDialog1.ShowDialog();
string text = System.IO.File.ReadAllText(openFileDialog1.FileName);
string line = File.ReadLines(openFileDialog1.FileName).Skip(2).FirstOrDefault();
TextBox1.Text = line;
}