var
f: TSearchRec;
sList: TstringList;
ft: TextFile;
begin
//获得文件列表
sList:=TstringList.Create;
if FindFirst(Path,0,f)=0 then
begin
sList.Add(f.Name);
while FindNext(f)=0 do sList.Add(f.Name);
end;
//处理文件
for i:=0 to sList.Count-1 do
begin
AssignFile(ft,sList[i]);
Reset(ft);
while not Eof(ft) do
begin
ReadLn(ft,sLine);
//处理文本sLine
end;
CloseFile(ft);
Erase(ft);
//或者CopyFile
end;
sList.Free;
end;
f: TSearchRec;
sList: TstringList;
ft: TextFile;
begin
//获得文件列表
sList:=TstringList.Create;
if FindFirst(Path,0,f)=0 then
begin
sList.Add(f.Name);
while FindNext(f)=0 do sList.Add(f.Name);
end;
//处理文件
for i:=0 to sList.Count-1 do
begin
AssignFile(ft,sList[i]);
Reset(ft);
while not Eof(ft) do
begin
ReadLn(ft,sLine);
//处理文本sLine
end;
CloseFile(ft);
Erase(ft);
//或者CopyFile
end;
sList.Free;
end;
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货