OpenFileDialog.FileFilter 奇怪的行为
在我的应用程序中,我有一个带有如下过滤器的 OpenFileDialog:Image Files|*.bmp;*.png;*.gif|All Files|*.*
。在我的机器上,对话框中的过滤器按应有的方式显示:
Image Files
All Files
但在我老板的机器上,对话框中的过滤器看起来像这样:
Image Files (*.bmp, *.png, *.gif)
All Files (*.*)
我没有一行代码可以更改过滤器,所以我不明白,到底为什么会这样显示。更奇怪的是,当我用我的帐户登录老板的计算机并运行同一个 .exe 时,我的老板尝试了一下,它的效果非常好!
我和我老板的机器都运行 Windows 7 Enterprise。
In my app I have an OpenFileDialog with a filter like this: Image Files|*.bmp;*.png;*.gif|All Files|*.*
. On my machine the filter in the dialog is displayed as it should be:
Image Files
All Files
But on my boss's machine the filter in the dialog looks like this:
Image Files (*.bmp, *.png, *.gif)
All Files (*.*)
I don't have a single line of code which may change the filter, so I do not understand, why on earth it is displayed this way. What's even more strange is that when I logged into my boss's computer under my account and ran just the same .exe my boss tried it worked like a charm!
Both my and my boss's machine run Windows 7 Enterprise.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我的猜测是您的 Windows 资源管理器设置指定在您的计算机上隐藏文件扩展名,而您的老板则配置为显示它们。
要检查此设置:
My guess is your Windows Explorer settings specify to hide file extensions on your machine, whereas your boss's is configured to show them.
To check this setting: