VB SaveFileDialog返回"没有与您的搜索匹配的项目。"例如,对于.txt的特定文件夹过滤。但是其他应用程序的打开文件对话框,例如。记事本将显示所有.txt文件。
答案 0 :(得分:0)
很抱歉没有发布任何代码,找到解决方案之后,我发现这很重要。 找到了解决方案
' This does not work i.e. dialog returns "No items match your search."
FileDialog1.Filter = ""
SaveFileDialog1.Filter += "|C/C++|*.cpp;*.c;*.h;*.rc"
SaveFileDialog1.Filter += "|CSharp|*.cs"
SaveFileDialog1.Filter += "|CSS|*.css"
SaveFileDialog1.Filter += "|eRuby|*.erb;*.rhtml"
SaveFileDialog1.Filter += "|Java|*.java"
SaveFileDialog1.Filter += "|JavaScript|*.js"
SaveFileDialog1.Filter += "|JSP|*.jsp"
' This solves the problem, dialog shows files with the selected file extension(s)
SaveFileDialog1.Filter = ""
SaveFileDialog1.Filter += "|C/C++ (*.cpp;*.c;*.h;*.rc)|*.cpp;*.c;*.h;*.rc"
SaveFileDialog1.Filter += "|CSharp (*.cs)|*.cs"
SaveFileDialog1.Filter += "|CSS (*.css)|*.css"
SaveFileDialog1.Filter += "|eRuby (*.erb;*.rhtml)|*.erb;*.rhtml"
SaveFileDialog1.Filter += "|Java (*.java)|*.java"
SaveFileDialog1.Filter += "|JavaScript (*.js)|*.js"
SaveFileDialog1.Filter += "|JSP (*.jsp)|*.jsp"
为了感兴趣,如果搜索使用参数的第一部分,例如 CSS(* .css)参数的第二部分(" |"分隔符后面的文件扩展名)的目的是什么?