关于查找目录的FindFirst 还是不成功阿
   var 
    st1:string;
    num:integer;
    Sear:TSearchRec;
    st1:='c:\';
    num:=findfirst(st1,faAnyFile,Sear);
   if num=0 then 
     showmessage('查找成功');
  大家评评理,为什么还是返回不了0,而是出现error信息码呢???????
  刚才收分的哥们帮忙阿

解决方案 »

  1.   

    stl应该包含文件夹的名字阿
    比如:c:\temp
    //---------------add--2002-03-10---sunfx
    {
     function searchfolder
     搜索文件夹是否存在
    }
    function  Tyeargzydfrm.searchfolder(var foldername:string):boolean;
    var
      path:string;
      sr: TSearchRec;
    begin
    path:=ExtractFilePath(Application.ExeName)+'report\'+foldername;
      if FindFirst(path, faAnyFile, sr) = 0 then
        begin
        if ((sr.Attr and fadirectory) = fadirectory) and (sr.Name<>'.') and (sr.Name<>'..') then
         begin
           result:=true;
         end;
         end //first
         else
         result:=false;
        FindClose(SR);
    end;