using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using System.IO; namespace WindowsFormsApp1 { public partial class Form1 : Form { //make new "string" variable to hold... string currentLine; //make new "string" array "all", which is populated by the results from searching said directory (and subdirectories) //looking for any text document named "File_Manager" String[] all = Directory.GetFiles(@"C:\Some File Name", "*.txt", SearchOption.AllDirectories); public Form1() { InitializeComponent(); } //method called when said button clicked private void ctoButton_Click(object sender, EventArgs e) { // "for" loop, that runs as many times is necessary to run through the "all" array for (int h = 0; h < all.Length; h++) { //making the data, in the present "all" array spot, readable StreamReader source = new StreamReader(all[h]); currentLine = source.ReadLine(); // close the file source.Close(); } // show a MessageBox that shows the nextLine variable MessageBox.Show($"{currentLine}"); } } }