0

我在尝试在目录中搜索带有通配符的文件夹时遇到问题。

该文件夹将如下所示:[2008][560909][Market Change] 或 [year][number][name]

到目前为止,这就是我所拥有的:

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 + "*")

请帮助我很困惑......

4

1 回答 1

0

您将需要使用System.IO.Directory.GetDirectories(rootPath, wildcardPattern)并查看返回的数组是否包含多个零元素。

于 2012-04-27T20:40:32.733 回答