Skip to content

Instantly share code, notes, and snippets.

@KaiserWerk
Last active March 23, 2020 18:15
Show Gist options
  • Select an option

  • Save KaiserWerk/a64cf3dff83021d5f4a8f8ffe434b513 to your computer and use it in GitHub Desktop.

Select an option

Save KaiserWerk/a64cf3dff83021d5f4a8f8ffe434b513 to your computer and use it in GitHub Desktop.
Dialogs
// Install NuGet package WindowsAPICodePack-Shell by Aybe
//
// using Microsoft.WindowsAPICodePack.Dialogs;
CommonOpenFileDialog dialog = new CommonOpenFileDialog();
dialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
dialog.IsFolderPicker = true;
if (dialog.ShowDialog() == CommonFileDialogResult.Ok)
{
Debug.WriteLine(dialog.FileName);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment