怎样寻找或打开相对路径下的文件名?谢谢帮忙解答!

解决方案 »

  1.   

    FindFirst FindNext FindClose三个函数,d的帮助有例子
      

  2.   

    http://expert.csdn.net/Expert/topic/2584/2584549.xml?temp=5.561465E-02
      

  3.   

    AppPath: string;AppPath:=ExtractFileDir(ParamStr(0));         //取应用程序路径然后....应该好办了
      

  4.   

    procedure TMonthFile.LoadFiles;
    var
      sr: TSearchRec;
      FileAttrs: Integer;
    begin
      FrmDbMaintain.clFile.Clear;
      FileAttrs := $2F;
      if FindFirst(AppDir + '\recbac\*.etb',FileAttrs,sr) = 0 then
      begin
        repeat
          if (sr.Attr and FileAttrs) = sr.Attr then
          begin
          with frmDbMaintain.clFile do
           begin
             //Cells[1,RowCount-1] := sr.Name;
             //Cells[2,RowCount-1] := IntToStr(sr.Size);
                  Items.Add(sr.Name);
              end;
          end;
        until FindNext(sr) <> 0;
        FindClose(sr);
      end;end;这是我以前的代码,可能有点乱,希望对你有用
      

  5.   

    to favan(SUPER.NET)
    再请麻烦帮我在旁边注解一下好吗,有些语句不是很清楚!
    非常感谢!