怎么得到一个某一目录下的文件列表
如何得到一个某一目录下的文件列表?
我希望从一指定目录里随机得到一个文件名,请问该如何实现?
------解决方案--------------------
The following code will enumerate all the files in the current directory, printing the name of each file:
CFileFind finder;
BOOL bWorking = finder.FindFile( "*.* ");
while (bWorking)
{
bWorking = finder.FindNextFile();
cout < < (LPCTSTR) finder.GetFileName() < < endl;
}
我希望从一指定目录里随机得到一个文件名,请问该如何实现?
------解决方案--------------------
The following code will enumerate all the files in the current directory, printing the name of each file:
CFileFind finder;
BOOL bWorking = finder.FindFile( "*.* ");
while (bWorking)
{
bWorking = finder.FindNextFile();
cout < < (LPCTSTR) finder.GetFileName() < < endl;
}