procedure TFrm_Main.DeleteOutOfDayDBS(strSourcePath: string;Days:integer);
var
FindResult: integer;
sr: TSearchRec;
dt:TDateTime;
begin
dt:=Now;
FindResult := FindFirst(strSourcePath + '*.mdb', faAnyFile - faDirectory - faHidden - faSysFile, sr);
try
while FindResult = NO_Error do //NO_Error=0, 当FindResult=0时表示搜索成功
begin
if dt-FileDateToDateTime(sr.Time)>Days then DeleteFile(strSourcePath + sr.Name);
FindResult := FindNext(sr); //下一个文件
end;
finally
FindClose(sr); //关闭搜索集
end;
end;
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请
点击举报。