WPF 中的OpenFileDialog和 OpenFolderDialog

 OpenFolderDialog:

            using (var dialog = new System.Windows.Forms.FolderBrowserDialog() { SelectedPath = destinationApp, ShowNewFolderButton = true })
            {
                System.Windows.Forms.DialogResult result = dialog.ShowDialog();
                if (result == System.Windows.Forms.DialogResult.OK)
                {
                    //TODO: use dialog.SelectedPath;
                }
            }

 OpenFileDialog:

            using (var dialog = new System.Windows.Forms.OpenFileDialog())
            {
                System.Windows.Forms.DialogResult result = dialog.ShowDialog();
                if (result == System.Windows.Forms.DialogResult.OK)
                {
                    //TODO: use dialog.FileName, FileNames;
                }
            }
原文地址:https://www.cnblogs.com/lopengye/p/7681471.html