我可以通过文件夹浏览器对话框选择文件,但我需要在树列表控件中显示所选文件(注意:我使用的是 WPF 和 devexpress 控件)。我怎样才能做到这一点?请检查图像:
*******************代码**********************
private void loadFilePst ()
{
try
{
Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog();
dlg.DefaultExt = ".pst";
dlg.Filter = "PST Files(*.pst)|*.pst";
Nullable<bool> output = dlg.ShowDialog();
if (dlg.ShowDialog() != true)
return;
using (Stream stream = dlg.OpenFile())
{
}
//if(output == true)
//{
// stgPath = dlg.FileName;
// string fileName = dlg.FileName;
// treePstSelect.Visibility = Visibility.Visible;
//}
//System.Windows.MessageBox.Show("Hola");
}
catch(Exception ae)
{
System.Windows.MessageBox.Show(ae.Message);
}
}