Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- OpenFileDialog opendialogfile = new OpenFileDialog();
- opendialogfile.Filter = "Lua File (*.lua)|*.lua|Text File (*.txt)|*.txt";
- opendialogfile.FilterIndex = 2;
- opendialogfile.RestoreDirectory = true;
- if (opendialogfile.ShowDialog() != DialogResult.OK)
- return;
- try
- {
- fastColoredTextBox1.Text = "";
- System.IO.Stream stream;
- if ((stream = opendialogfile.OpenFile()) == null)
- return;
- using (stream)
- this.fastColoredTextBox1.Text = System.IO.File.ReadAllText(opendialogfile.FileName);
- }
- catch(Exception ex)
- {
- int num = (int)MessageBox.Show("An unexpected error has occured", "OOF!", MessageBoxButtons.OK, MessageBoxIcon.Information);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement