怎么将一个文件夹的所有文本文件名读取,然后在分别读取每个文件的内容

xudehui 2004-09-30 07:20:41
怎么将一个文件夹的所有文本文件名读取,然后在分别读取每个文件的内容
...全文
105 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
软件钢琴师 2004-09-30
  • 打赏
  • 举报
回复
学习
jackie168 2004-09-30
  • 打赏
  • 举报
回复
procedure TForm1.Button1Click(Sender: TObject);
var ss:TSearchRec;
filepath:string;
begin
filepath:='c:\';
listbox1.Items.Clear;
if FindFirst(filepath+'\*.txt',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;

828

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 非技术区
社区管理员
  • 非技术区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧