procedure TSanFile.DoSan(const Path:string);
var
FSR:TSearchRec;
begin
if FindFirst(Path+'/*.*',faAnyFile,FSR)=0 then
try
FPath:='当前扫描路径:'+Path+'/';
Synchronize(AddLog);
FindNext(FSR);
while (FindNext(FSR)=0) and (not Terminated) do
begin
//AddLog;
if ((FSR.Attr and faDirectory)<>faDirectory) then //如果是文件,这个代码你自己修改
AddInf(Path+'/'+FSR.Name,FSR.Size)
else //如果是文件夹,自己加代码
DoSan(Path+'/'+FSR.Name);
end;
finally
FindClose(FSR);
end;
end;