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;
http://community.csdn.net/Expert/topic/3723/3723238.xml?temp=.641247
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;
http://community.csdn.net/Expert/topic/3723/3723238.xml?temp=.641247