如:
000001.pdg
000002.pdg
000003.pdg
......
000306.pdg
000307.pdg
......

解决方案 »

  1.   

    引用Microsoft Script Control 1.0库。
    用Folder和File对象即可。
      

  2.   

    写错了,应该是Microsoft Scripting Runtime
      

  3.   

    Dim temp As String
    Dim count As Integer
    count = 0
    temp = Dir("c:\0*.pdg")
    If temp <> "" Then
        Do
            DoEvents
            count = count + 1
            temp = Dir()
        Loop Until temp = ""
    End If
    Debug.Print count
      

  4.   

    呵呵   糊写的不过也可以达到你的要求
    Private Sub Form_Load()
    Dim fso, fFolder, ffFile
    Set fso = CreateObject("Scripting.FileSystemObject")
    Dim i As Integer
    i = 0
    Set fFolder = fso.GetFolder("c:\1") '假设在C:\1文件夹下
    Set fFile = fFolder.Files
    For Each ffFile In fFile
    If Left(ffFile.Name, 1) = "0" And Right(ffFile.Name, 4) = ".pdg" Then
    i = i + 1
    End If
    Next
    MsgBox iEnd Sub