Right now this code just searches 1 directory, how can i get it to search the original directory and all the sub-directories
Code:Imports System.IO Public Class Form1 Dim strFileSize As String = "" Dim di As New IO.DirectoryInfo("C:\Pictures") Dim aryFi As IO.FileInfo() = di.GetFiles("*.*") Dim fi As IO.FileInfo Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load For Each fi In aryFi If fi.Extension = ".jpg" Or fi.Extension = ".gif" Or fi.Extension = ".bmp" Or fi.Extension = ".png" Or fi.Extension = ".PNG" Or fi.Extension = ".JPG" Then ''etc etc etc ListBox1.Items.Add(fi.Name) End If Next End Sub End Class




Reply With Quote