There are some steps you have to do:
+ The first, you must add chain: "\\*.*" after your path.
+ The second, calling FindFirstFileA function to find the first file in your folder
+ Then you calling FindNextFileA function to find all file to the end
And this is my source code that you can use:
// You have to use windows.h and tchar.h library
char * pathFolder = "D:";
char* FileNext;
WIN32_FIND_DATAA findFile;
HANDLE hfind;
char folderFind[255];
int isFinish;
HANDLE hfind;
char folderFind[255];
int isFinish;
hfind = FindFirstFileA(folderFind,&findFile);
isFinish = FindNextFileA(hfind,&findFile);
while(isFinish)
{
FileNext = findFile.cFileName; // Do with your file's name
isFinish = FindNextFileA(hfind,&findFile);
}
Best wishes for you. Thanks for visting my blog!
Do your best, the rest will come!
Không có nhận xét nào:
Đăng nhận xét