为什么过滤器扩展不显示OpenFileDialog
?我对此进行了测试,但对话框未显示DAT
扩展名。如果我DAT
在列表扩展的第一个中获得扩展,则OpenFileDialog
在对话框中进行过滤。我C#
在 Win XP 上使用 Application-FrameWork 3.5。
这是我的代码:
OpenFileDialog openFileDialog = new OpenFileDialog();
string VideoFormat = "Video files |*.wmv; *.3g2; *.3gp; *.3gp2; *.3gpp; *.amv; *.asf; *.avi; *.bin; *.cue; *.divx; *.dv; *.flv; *.gxf; *.iso; *.m1v; *.m2v; *.m2t; *.m2ts; *.m4v; " +
" *.mkv; *.mov; *.mp2; *.mp2v; *.mp4; *.mp4v; *.mpa; *.mpe; *.mpeg; *.mpeg1; *.mpeg2; *.mpeg4; *.mpg; *.mpv2; *.mts; *.nsv; *.nuv; *.ogg; *.ogm; *.ogv; *.ogx; *.ps; *.rec; *.rm; *.rmvb; *.tod; *.ts; *.tts; *.vob; *.vro; *.webm; *.dat; ";
openFileDialog.Filter = VideoFormat;
openFileDialog.ShowDialog();
但是这段代码在对话框中过滤了 DAT 扩展:
OpenFileDialog openFileDialog = new OpenFileDialog();
string VideoFormat = "Video files | *.dat; *.wmv; *.3g2; *.3gp; *.3gp2; *.3gpp; *.amv; *.asf; *.avi; *.bin; *.cue; *.divx; *.dv; *.flv; *.gxf; *.iso; *.m1v; *.m2v; *.m2t; *.m2ts; *.m4v; " +
" *.mkv; *.mov; *.mp2; *.mp2v; *.mp4; *.mp4v; *.mpa; *.mpe; *.mpeg; *.mpeg1; *.mpeg2; *.mpeg4; *.mpg; *.mpv2; *.mts; *.nsv; *.nuv; *.ogg; *.ogm; *.ogv; *.ogx; *.ps; *.rec; *.rm; *.rmvb; *.tod; *.ts; *.tts; *.vob; *.vro; *.webm; ";
openFileDialog.Filter = VideoFormat;
openFileDialog.ShowDialog();