FreeBuffer;
end;
// 扫描目录 (递归扫描子目录)
Procedure ScanDir(ADirName : string; AScanSubDir : boolean);
var
FS : TFileSearch;
begin
ADirName := NormalDir(ADirName);
FS := TFileSearch.Create(nil);
FS.FindFirst(ADirName + '*.*');
while FS.Found do begin
if FS.IsDir then begin
if AScanSubDir and (FS.FileName <> '.') and (FS.FileName <> '..') then
ScanDir(ADirName + FS.FileName, AScanSubDir)
end else
ScanFile(ADirName + FS.FileName);
FS.FindNext;
end;
FS.Free;
end;