12345678910111213141516171819202122232425262728
#include <windows.h> #include <iostream> #include <stdio.h> using namespace std; int main() { WIN32_FIND_DATA FindFileData; HANDLE hFind; char szFolder[] = "C:\\Temp\\*.*"; cout << "Files in " << szFolder << endl; hFind = FindFirstFile(szFolder, &FindFileData); if (hFind == INVALID_HANDLE_VALUE) { cout << "Error " << endl; exit(-1); } while ( FindNextFile(hFind, &FindFileData)) if (FindFileData.cFileName[0] != '.') cout << FindFileData.cFileName << endl; FindClose(hFind); system("pause"); }