Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to get all file name in a folder

How to get all file name in a folder

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Y Offline
    Y Offline
    ytod
    wrote on last edited by
    #1

    Can somebody tell me how to get all file path name in a specified folder? Thanks.

    L 1 Reply Last reply
    0
    • Y ytod

      Can somebody tell me how to get all file path name in a specified folder? Thanks.

      L Offline
      L Offline
      l00p1n6
      wrote on last edited by
      #2

      CString theFileNamePath; CString extension("*.txt"); CString filePath("C://"); CString completeFilePath; HANDLE handleToFind; WIN32_FIND_DATA FindInfo; WIN32_FIND_DATA *FindInfoPoint = &FindInfo; completeFilePath.SetString(filePath+ extension); handleToFind = FindFirstFile(completeFilePath,FindInfoPoint); while(handleToFind != NULL) { theFileNamePath = completeFilePath+ FindInfo.cFileName; //....SOMETHING.... if (FindNextFile(handleToFind,FindInfoPoint) == 0) break; }//while FindClose(handleToFind); hope that'll do:)

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups