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;
                }
            }

 

posted on 2017-10-17 14:27  lopengye  阅读(591)  评论(0编辑  收藏  举报

导航