First 包含 .h 檔:
#include <direct.h>
定義:
struct _finddata_t ff;
long hFind;
hFind = _findfirst(searchPath, &ff); //searchPath 是全路徑
if(!hFind) //如 hFind = 0, 則沒找到
exit(0);//or return or dod whatever
do{
//找到的檔案在 ff.name 裡, 但只有檔案, 沒有路徑
} while( !_findnext(hFind, &ff ) );
_findclose(hFind);