Results 1 to 2 of 2

Thread: using dir, finding files, and image properties

  1. #1
    Guest

    Question

    hi,
    in my project i need to count the files in a folder and do some other stuff that i will explain later.
    first, i chose a folder. it contains jpg, gif and bmp images. i want to know how many files are in that dir and get all therire names into a list or string. i will use the names to create links in html.
    and if i'm dealing with images, it would be good to know how to retrive hight and width of images.
    also, in that list i'm making it will be good to insert a number along with the file so i can later arrange the files into several html pages, but still keep the original (unnumbered) names..

    thanks...

  2. #2
    Guest
    To list and count files in a certain directory:

    Code:
    Private Sub Command1_Click()
    
        Dim FileFinder
        List1.Clear
        FileFinder = Dir("C:\Windows\")
        Do Until FileFinder = ""
        List1.AddItem LCase(FileFinder)
        FileFinder = Dir
        Loop
        Msgbox "There are " & List1.ListCount & " files in that directory."
    
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width