vb怎么获取一个文件夹里面有多少张图片
2015-09-02
展开全部
Private Sub Command1_Click()
Dim myPath As String
Dim FileList As FileListBox
myPath = "C:\" '路径
Set FileList = Me.Controls.Add("VB.FileListBox", "fl")
FileList.Path = myPath
FileList.Pattern = "*.bmp;*.jpg" '这里将所有图片的扩展名都列上
Print "图片数:" & FileList.ListCount
Me.Controls.Remove FileList
Set FileList = Nothing
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询