var
f:TextFile;
i:Integer;
sTextName,sText:String;
begin
////////////////////////////////////////////////////////////////////////////
if (Listbox1.ItemIndex <> 1 ) then
begin
for i := 0 to Listbox1.Items.Count-1 do begin
sTextName:=ListBox1.Items.Strings[i];
if FileExists(sTextName) then
AssignFile(f,sTextName); // 建立文件连接
Reset(f); while not Eof(f) do
begin
ReadLn(f,sText);//开始读文件中的数据 整行读取
RichEdit1.Lines.Append(sText); //输出数据到文本
end;
CloseFile(f); //关闭读完的文件
end;
end;
////////////////////////////////////////////////////////////////////////////end;end.
f:TextFile;
i:Integer;
sTextName,sText:String;
begin
////////////////////////////////////////////////////////////////////////////
if (Listbox1.ItemIndex <> 1 ) then
begin
for i := 0 to Listbox1.Items.Count-1 do begin
sTextName:=ListBox1.Items.Strings[i];
if FileExists(sTextName) then
AssignFile(f,sTextName); // 建立文件连接
Reset(f); while not Eof(f) do
begin
ReadLn(f,sText);//开始读文件中的数据 整行读取
RichEdit1.Lines.Append(sText); //输出数据到文本
end;
CloseFile(f); //关闭读完的文件
end;
end;
////////////////////////////////////////////////////////////////////////////end;end.
解决方案 »
- cxgrid CellMultiSelect 使用问题
- v.28 打印的问题
- Delphi的OleContainer调用Word碰到的问题
- 请问一个数据库的问题关于ADO的技术
- 网络技术问题,可能很简单,今晚10:00结贴。回贴up者有分。
- 请问Delphi中的Private和Public的使用与c++中的有区别吗?
- 我有一个报表.dll文件1M,请问如何减小一半,不压缩,有什么好方法?可否用写ini文件,急!!!!
- 怎样由客户姓名获取客户姓名的拼音代码?
- :用adoquery1.cancelbatch时,出现A given Hrow refered to a hard-or soft-deleted row的错误
- 谁用过TextRect这个过程,为什么它的最后一个参数TextFlags无法用,一加上这个参数就报告参数个数太多?
- 如何编写图片浏览程序
- delphi反编译后修改问题???请赐教
//等于1为什么不行?
//sTextName是否包含了扩展名?如果没有,前一句改成:
sTextName:=trim(ListBox1.Items.Strings[i])+'.txt';
ListBox1.Items.Strings[i]//列表框的显示300.txt
我在列表框已经成功提取到300.txt 400.txt。了我想自动循环逐个列表框里的文件名,然后逐个把相应的文件内容自动添加到RichEdit1显示
sTextName:='C:\Test\'+ ListBox1.Items.Strings[i];
sTextName := PathName+ListBox1.Items.Strings[i];