procedure TForm1.Button1Click(Sender: TObject);begin GetFiles('D:/Prj', 'D:/A.INI'); --搜索路径,保存文件名称end;Function FileTImeToDateTime(FileTime:TFileTime):TDateTime;Var sysTime:TSystemTime;begin if not FileTimeToSystemTime(FileTime,SysTime) then raise EConvertError.CreateFmt('FileTimeToSystemTime failed. Error Code %d',[GetLastError]); with SysTime do Result:=EncodeDate(wYear,wMonth,wDay)+EncodeTime(wHour,wMinute,wSecond,wMilliseconds)End;procedure TForm1.GetFiles(DirName, SaveINIFileName: String);var sr: TSearchRec; sSearch:String;begin sSearch:=DirName+'/*.*'; if FindFirst(sSearch, faAnyFile , sr) = 0 then begin repeat if (sr.Name='.') or (sr.Name='..') then continue; if (sr.Attr and faDirectory)>0 then GetFiles(DirName+'/'+Sr.Name,SaveINIFileName) else begin WritePrivateProfileString( PChar(sr.Name),'FilePath',PChar(DirName), PChar(SaveINIFileName) ); WritePrivateProfileString( PChar(sr.Name),'DateTime',PChar(Datetimetostr(FileTImeToDateTime(Sr.FindData.ftLastWriteTime))), PChar(SaveINIFileName) ); end; until FindNext(sr) <> 0; FindClose(sr); end;end;如果符合你的要求就给分。