© 2026 Hedgehog Software, LLC
[STAThread
OpenFileDialog
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>Exe</OutputType> <TargetFramework>net8.0-windows</TargetFramework> <ImplicitUsings>enable</ImplicitUsings> <Nullable>enable</Nullable> <UseWPF>true</UseWPF> </PropertyGroup> </Project>
using Microsoft.Win32; internal class Program { [STAThread] private static void Main() { OpenFolderDialog folderDialog = new(); if (folderDialog.ShowDialog() is true) { string mainFolderPath = folderDialog.FolderName; Console.WriteLine($"Selected folder: {mainFolderPath}"); } Console.WriteLine("\nPress any key to continue..."); Console.ReadKey(); } }