/ *
Target: Read all file names in a directory
* /
#include
#include
Using namespace std;
Int main (int Argc, char * argv [])
{
Win32_find_data filedata;
Handle hSearch;
Bool bfinished = false;
HSEARCH = FindfirstFile ("C: //*.*", & FileData);
IF (HSearch == Invalid_Handle_Value)
{
COUT << "can't find any file!" << endl;
Return 0;
}
Cout << FileData.cfilename << endl;
While (! bfinished)
{
IF (! FindNextFile (HSearch, & FileData))
{
Cout << "no more file!" << Endl;
Return 0
}
}
Return 0;
}