uses
filectrl
var
jpg,txt:byte;
MainPath:String;
SearchRec:TsearchRec;
begin
jpg:=0;
txt:=0;
MainPath:='F:/图象/jpg';
if copy(MainPath,length(MainPath),1)<>'/' then mainPath:=mainPath+'/';
if(DirectoryExists(MainPath)=true) then
begin
Application.ProcessMessages;
////////////////////查找文件并加入///////////////////////////////////
FindFirst(Mainpath+'*.*', faAnyfile, SearchRec);
if ExtractFileExt(SearchRec.name)='.gif' then
jpg:=jpg+1;
while (FindNext(SearchRec)=0) dO
BEGIN
if ExtractFileExt(SearchRec.name)='.gif' then
jpg:=jpg+1;
END;
showMessage('共有gif文件:'+intToStr(jpg));
////////////////////////////////////////////////////////////////
end else MessageBox(handle,'目录不存在!', '系统提示',MB_ICONERROR);
end