chikusa
Messages postés11Date d'inscriptiondimanche 24 avril 2011StatutMembreDernière intervention24 août 2011
-
17 juin 2011 à 11:19
chikusa
Messages postés11Date d'inscriptiondimanche 24 avril 2011StatutMembreDernière intervention24 août 2011
-
17 juin 2011 à 13:33
Bonjour a tous,
Voila mon, problème, j'essaye de lister tous les txt d'un repertoire avec les fonctions FindFirstFile et FindNextFile. Le problème qui se pose est qu'il affiche un fichier sur deux. imaginons que j'ai 7 fichiers txt, le programme n'en lira que 3 en en sautant 1 sur 2.
voici mon code :
#include <cstdlib>
#include
#include <windows.h>
using namespace std;
int main(int argc, char *argv[])
{
WIN32_FIND_DATA FindData;
HANDLE hFind = FindFirstFile("C:\\ProgramData\\Contact\\*.txt", &FindData);
cout << FindData.cFileName << endl;
while(FindNextFile(hFind, &FindData) != 0)
{
FindNextFile(hFind, &FindData);
cout << FindData.cFileName << endl;
}
system("Pause");
return 0;
}
The power is mine !!