close
function GetAllfile(source_path: string): Tstringlist;
var filelist: Tstringlist;
procedure FindAll(const Path: string);
var
sr: TSearchRec;
fr: Integer;
temp_str: string;
begin
fr := FindFirst(Path + '\*.*', faAnyFile, sr);
while fr = 0 do
begin
if (sr.Attr = faDirectory) and (sr.Name <> '.') and (sr.Name <> '..') then
FindAll(Path + '\' + sr.Name) //???d§a?U?@?¥O?
else
if (sr.Name <> '.') and (sr.Name <> '..') then
begin
filelist.Append(copy(path, length(source_path) + 1, length(path) - length(source_path)) + '\' + sr.name);
// showmessage(copy(path,length(source_path)+1,length(path)-length(source_path)) + '\' + sr.name);
end;
temp_str := sr.name;
FindNext(sr);
if temp_str = sr.Name then
break;
end;
FindClose(sr);
end;
begin
filelist := Tstringlist.Create;
FindAll(source_path);
result := filelist;
// filelist.Free;
end;
文章標籤
全站熱搜
留言列表