我无法尝试在目录中搜索带通配符的文件夹。
该文件夹看起来像这样:[2008] [560909] [市场变化]或[年] [数字] [名称]
到目前为止,这就是我所拥有的:
Function searching()
Dim choice, input
Dim strPatheServices
strPatheServices = "s:\dirr\subdirr\"
ending = true
choice = InputBox("Please choose: c for number, y for year created, n for name")
If choice = "c" Then
MsgBox ("You entered: " & choice)
input = InputBox("Please input a number:")
System.IO.Directory.Exists(strPatheServices\input)
ElseIf choice = "y" Then
MsgBox ("You entered: " & choice)
input = InputBox("Please input a year:")
System.IO.Directory.Exists(strPatheServices\input)
ElseIf choice = "n" Then
MsgBox ("You entered: " & choice)
input = InputBox("Please input a number:")
System.IO.Directory.Exists(strPatheServices\input)
End If
MsgBox "Done",,"Completed"
End Function
我不知道从哪里开始除了将外卡添加到存在之外如此:
System.IO.Directory.Exists(strPatheServices\input + "*")
请帮助我很困惑......
答案 0 :(得分:0)
您将需要使用System.IO.Directory.GetDirectories(rootPath, wildcardPattern)
并查看返回的数组是否包含多于零的元素。