Visual Studio / WPF > アプリケーションのフォルダを取得する > System.AppDomain.CurrentDomain.BaseDirectory


動作環境
Windows 7 Pro (32bit)
Microsoft Visual Studio 2017 Community

実行ファイル(.exe)のフォルダを取得したい。

MainWindow.xaml.cs
        private void B_read_Click(object sender, RoutedEventArgs e)
        {
            string appPath = System.AppDomain.CurrentDomain.BaseDirectory;
            MessageBox.Show(appPath);
        }

関連情報 http://dobon.net/vb/dotnet/vb6/apppath.html