Charliezkie

Folder Browser Dialog

Jun 21st, 2020
1,259
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.47 KB | None | 0 0
  1. using (var fbd = new FolderBrowserDialog())
  2.             {
  3.                 DialogResult result = fbd.ShowDialog();
  4.  
  5.                 if (result == System.Windows.Forms.DialogResult.OK && !string.IsNullOrWhiteSpace(fbd.SelectedPath))
  6.                 {
  7.                     string[] files = Directory.GetFiles(fbd.SelectedPath);
  8.  
  9.                     System.Windows.Forms.MessageBox.Show("Files found: " + files.Length.ToString(), "Message");
  10.                 }
  11.             }
Advertisement
Add Comment
Please, Sign In to add comment