PareX

OpenFileDialog

May 19th, 2019
13,278
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //MADE BY PAREX |PEOPLE GIVING U THIS LINK IS COPY RIGHT
  2. OpenFileDialog opendialogfile = new OpenFileDialog();
  3.             opendialogfile.Filter = "Lua File (*.lua)|*.lua|Text File (*.txt)|*.txt";
  4.             opendialogfile.FilterIndex = 2;
  5.             opendialogfile.RestoreDirectory = true;
  6.             if (opendialogfile.ShowDialog() != DialogResult.OK)
  7.                 return;
  8.             try
  9.             {
  10.                 fastColoredTextBox1.Text = "";
  11.                 System.IO.Stream stream;
  12.                 if ((stream = opendialogfile.OpenFile()) == null)
  13.                     return;
  14.                 using (stream)
  15.                     this.fastColoredTextBox1.Text = System.IO.File.ReadAllText(opendialogfile.FileName);
  16.             }
  17.             catch(Exception ex)
  18.             {
  19.                 int num = (int)MessageBox.Show("An unexpected error has occured", "OOF!", MessageBoxButtons.OK, MessageBoxIcon.Information);
  20.  
  21.             }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×