1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
#include <stdio.h>
#include <stdlib.h>
#define _WIN32_WINNT 0x0500
#include <windows.h>
#include <winable.h>
#include <sys/types.h>
#include <dirent.h>
int main()
{
int i;
char NOM_FICHIER[20][256],FICHIER_LIRE[20][256];
WIN32_FIND_DATA File;
HANDLE hSearch;
BOOL re;
hSearch=FindFirstFile("*.*", &File);
if(hSearch == INVALID_HANDLE_VALUE)
{
//return FALSE;
}
re = FindNextFile(hSearch, &File);re = FindNextFile(hSearch, &File);
re=TRUE;
i=0;
do
{
/*if (!strcmp(File.cFileName,"*.exe*"))
{*/
i++;
strcpy(NOM_FICHIER[i],File.cFileName);
printf(" %2d : %s\n",i,NOM_FICHIER[i]);
//}
re = FindNextFile(hSearch, &File);
} while(re);
FindClose(hSearch);
Sleep( 5000 );
return 0;
} |