随笔 - 2146  文章 - 97 评论 - 11767 trackbacks - 253

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  万一  阅读(...)  评论(...编辑  收藏