Do so,
Just instantiate and call.
static class Program
{
[STAThread]
static void Main(string[] args)
{
FolderBrowserDialog fbd = new FolderBrowserDialog();
if (fbd.ShowDialog() == DialogResult.OK)
{
foreach (var path in Directory.GetFiles(fbd.SelectedPath))
{
Console.WriteLine(path); // full path
Console.WriteLine(System.IO.Path.GetFileName(path)); // file name
}
}
}
}
Source: https://stackoverflow.com/questions/15270387/browse-for-folder-in-console-application
MUST ADD THE REF. to System.Windows.Forms
as our friend @Iago Correia Guimarães recalled well.
and reference System.Windows.Forms
– Iago Correia Guimarães
That’s it.
– PauloHDSousa
That’s what I was looking for, thank you :D
– Jonathan Barcela