遍历文件夹取文件名
#include "stdio.h"
#include AnsiString s_filename[100];
int i=1;
TSearchRec sr;
AnsiString sAppPath;
sAppPath=ExtractFilePath(Application->ExeName);
sAppPath=sAppPath+"\\Data\\";
//列举所有文件
if(FindFirst(sAppPath+"*.mdb",faAnyFile,sr)==0)
{
do
{
if(!(sr.Attr & faDirectory) && sr.Name !="." & sr.Name!="..")
{
s_filename[i]=sr.Name;
i++;
}
} while (FindNext(sr)==0);
FindClose(sr);
}