比如:
我想把:c:\temp目录下的所有文件(
c:\temp\a.exe;
c:\temp\temp2\aac.exe;
c:\temp\temp3\byc.exe;
............................
找出来,连同路径一起放入tstrings里面!!!
谢谢!!!
我想把:c:\temp目录下的所有文件(
c:\temp\a.exe;
c:\temp\temp2\aac.exe;
c:\temp\temp3\byc.exe;
............................
找出来,连同路径一起放入tstrings里面!!!
谢谢!!!
uses
Windows,Forms, SysUtils, Variants, Classes, Controls, ComCtrls,
StdCtrls, ButtonXPMACCorel,Messages, ShellCtrls;var
i:integer;
searchRec:TsearchRec;
seat:string;
begin
filepa:=stv1.SelectedFolder.PathName;
filepa:=filepa+'\';
if (FindFirst(filepa+'.*', faAnyFile-faDirectory, SearchRec)=0) then
begin
Form1.ListBox1.Items.Add(filepa+searchrec.Name);
while (FindNext(SearchRec) = 0) do
Form1.ListBox1.Items.Add(filepa+searchrec.Name);
end;
FindClose(SearchRec);
end;
close;
end;
当然你可以不要那个控件,自己把filepa改成目录名!ok了!祝你好运!
当然你可以把TListBox控件换成TString