Read the program of the file name under a directory

xiaoxiao2021-03-05  24

/ *

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;

}

转载请注明原文地址:https://www.9cbs.com/read-35107.html

New Post(0)