如何抓取一個目錄下的所有(很多)文件的名稱?

解决方案 »

  1.   

    你又开啊。
    http://community.csdn.net/Expert/topic/3723/3723238.xml?temp=.641247
      

  2.   

    procedure TForm1.Button1Click(Sender: TObject);
    var ss:Tsearchrec;
    filepath:string;
    begin
       filepath:='c:\';
       listbox1.Items.Clear;
       if findfirst(filepath+'*.*',faAnyFile,ss)=0 then
       begin
       if not ((ss.Attr and fadirectory)=fadirectory) then
       listbox1.Items.Add(ss.Name);
       while findnext(ss)=0 do
       begin
       if not ((ss.attr and fadirectory)=fadirectory) then
       listbox1.Items.Add(ss.Name);
       end;
       findclose(ss);
       end;
    end;
      

  3.   

    你又开啊。
    http://community.csdn.net/Expert/topic/3723/3723238.xml?temp=.641247