wpf调用文件目录打开目录选择对话框
编程开发
WPFC#win32OpenFileDialog
wpf实现调用文件目录选择对话框
//调取文件选区对话框
Microsoft.Win32.OpenFileDialog ofd = new Microsoft.Win32.OpenFileDialog();
ofd.DefaultExt = ".txt";
ofd.Filter = "text file|*.txt";
if (ofd.ShowDialog() == true)
{
//ofd.FileName;
}
//调取文件夹对话框
//使用System.Windows.Forms命名空间下的FolderBrowserDialog类
FolderBrowserDialog Dialog = new FolderBrowserDialog();
DialogResult result = Dialog.ShowDialog();
if (result == System.Windows.Forms.DialogResult.Cancel)