manski

Open File Dialog

Aug 9th, 2012
32
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. OpenFileDialog openDialog = new OpenFileDialog();
  2. openDialog.Title = "Select database file";
  3. openDialog.DefaultExt = ".db"; // Default file extension
  4. openDialog.Filter = "Database File (.db)|*.db|All Files|*.*"; // Filter files by extension
  5.  
  6. if (openDialog.ShowDialog() == true) {
  7.   LoadData(openDialog.FileName);
  8. }
RAW Paste Data