利用帮助知识:
Dim cnt As Integer For Each File As String In FileSys.GetFiles("C:\data\") file = File.Tolower If file.EndsWith(".jpg") OrElse file.EndsWith(".gif") OrElse file.EndsWith(".bmp") cnt = cnt + 1 End IfNextmessagebox.show(cnt)