To lazy to make a tutorial

-what you need
using System.IO; (top of code)
OpenFileDialog (renamed dialog)
TextBox (txtData)


           
txtData.Text = "";

string strFileLoc = "";

dialog.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*";
dialog.InitialDirectory = "C:"; dialog.Title = "Open";

if (dialog.ShowDialog() == DialogResult.OK)
{
strFileLoc = dialog.FileName;

try
{
using (StreamReader sr = new StreamReader(strFileLoc))
{
string line;
while ((line = sr.ReadLine()) != null)
{
txtData.Text += line + "\r\n";
}
}
}
catch (Exception ex)
{
MessageBox.Show("Failed to open document. Maybe it doesn't exist or the data is corrupted?", "Error");
}

}
else if (strFileLoc == String.Empty)
{
return;
}


Uses FileDialog to find the .txt file the user wants to open, saves the location in a string, StreamReader opens / reads all info in the .txt file.