DialogResult result = openFileDialog1.ShowDialog();
if (result == DialogResult.OK)
{
string file = openFileDialog1.FileName;
try
{
string text = File.ReadAllText(file);
textBox1.Text = (text);
}
catch (IOException exception)
{
MessageBox.Show(exception.Message);
}
}