OpenFileDialog过滤器无法在Windows 7上运行

时间:2012-04-26 17:54:49

标签: c# wpf filter openfiledialog

我在OpenFileDialog上设置了以下过滤器:

MyApp Files (*.ced, *.cdr, *.wrp, *.wrap, *.out) | *.ced; *.cdr; *.wrp; *.wrap; *.out | All Files (*.*) | *.*

问题是.out文件没有出现。我做错了吗?

2 个答案:

答案 0 :(得分:2)

想出来,我必须删除分号之间的空格,如下所示:

MyApp Files (*.ced, *.cdr, *.wrp, *.wrap, *.out) |*.ced;*.cdr;*.wrp;*.wrap;*.out| All Files (*.*) | *.*

答案 1 :(得分:0)

用以下内容替换过滤器表达式应解决问题

OpnefileDlg.Filter = "(*.ced, *.cdr, *.wrp, *.wrap) | *.ced, *.cdr, *.wrp, *.wrap | All Files (*.*) | *.*";