procedure DelFiles(f: string);
var
  SearchRec: TSearchRec;
begin
  ChDir(ExtractFilePath(f));  //进入文件路径
  FindFirst(f, faAnyFile, SearchRec);
  repeat
    if FileExists(SearchRec.Name) then
    begin
      //FileSetAttr(SearchRec.Name,0); //修改文件属性为普通属性值
      DeleteFile(SearchRec.Name); //删除文件
    end;
  until(FindNext(SearchRec)<>0);
  FindClose(SearchRec);
end;

posted on 2007-11-24 23:43  万一  阅读(3180)  评论(2编辑  收藏  举报