Private strFiles(20)
Private Sub GetFiles(ByVal strFolder As String, ByVal ty As String) ‘ 获取文件列表
If iFiles = 0 Then
Erase strFiles
End If
If iFiles > 20 Then
Exit Sub
End If
Dim
FilePaths, FilePath As String
FilePaths = strFolder & "\*."
& ty
FilePath = Dir(FilePaths)
‘Dir返回匹配*.*的第一个文件名
Do While FilePath <> ""
strFiles(iFiles) = strFolder & "\" & FilePath
iFiles = iFiles + 1
FilePath = Dir
‘再一次调用Dir,得到其它匹配*.*的文件名
Loop
End Sub
时间: 2024-11-11 17:04:06