Adding Files from Directory/SubDirectory to Listbox

  • Thread starter Thread starter Ivan Weiss
  • Start date Start date
I

Ivan Weiss

Hey all, I want to add all of the file names from a directory and
subdirectory. I am unfamiliar with how to do this, does anyone know how
or have any starting points?

I am trying to create an mp3 playlist for my Media Player.

-Ivan
 
Hi Ivan,

This should get you started - I load all of the filenames from a certain sub
into a listbox:
Dim mdirectory As DirectoryInfo

Dim mfile As FileInfo

Me.Cursor = Cursors.WaitCursor

mdirectory = New DirectoryInfo("f:\olddbfs")

For Each mfile In mdirectory.GetFiles

If mfile.Extension.ToLower = ".dbf" Then

dbfstoconvert.Items.Add(mfile.Name)

End If

If mfile.Extension.ToLower = ".db_" Then

dbfsconverted.Items.Add(mfile.Name)

End If

Next

HTH,

Bernie Yaeger
 
Back
Top