06 | BOOL DirectoryList(LPCSTR Path) |
08 | WIN32_FIND_DATA FindData; |
11 | char FilePathName[LEN]; |
13 | char FullPathName[LEN]; |
14 | strcpy(FilePathName, Path); |
15 | strcat(FilePathName, "\\*.*"); |
16 | hError = FindFirstFile(FilePathName, &FindData); |
17 | if (hError == INVALID_HANDLE_VALUE) |
22 | while(::FindNextFile(hError, &FindData)) |
25 | if (strcmp(FindData.cFileName, ".") == 0 |
26 | || strcmp(FindData.cFileName, "..") == 0 ) |
32 | wsprintf(FullPathName, "%s\\%s", Path,FindData.cFileName); |
35 | printf("\n%d %s ", FileCount, FullPathName); |
37 | if (FindData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) |
40 | DirectoryList(FullPathName); |
51 | DirectoryList("D:eclipse-J2EE"); |
转载于:https://my.oschina.net/abcMx/blog/103212