Stream open; if (openFileDialog1.ShowDialog() == DialogResult.OK) { try { if ((open = openFileDialog1.OpenFile()) != null) { open.Close(); StreamReader r = new StreamReader(openFileDialog1.FileName); richTextBox1.Text = r.ReadToEnd(); r.Close(); } } catch (Exception ex) { MessageBox.Show("Could not read File!" + ex.Message, " Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)