procedure TForm1.Button1Click(Sender: TObject);
var
Flogfile:textfile;
Slogrec:string;
Llogrec:Tstringlist;
i:integer;
rowitem:tlistitem;
begin
assignfile(Flogfile,'E:\系统\rizhi1.txt');
reset(Flogfile);
try
begin
while not eof(Flogfile) do
begin
readln(Flogfile,Slogrec);
Slogrec:=copy(Slogrec,3,length(Slogrec)-4);
Llogrec:=splitstring(Slogrec,'^');
rowitem:=self.ListView1.items.add;
for i:=0 to Llogrec.Count-1 do
begin
case strtoint(leftstr(Llogrec[i],1)) of
1: rowitem.SubItems.Strings[0]:=copy(Llogrec[i],2,length(Llogrec[i])-1);
2: rowitem.SubItems.Strings[1]:=copy(Llogrec[i],2,length(Llogrec[i])-1);
3: rowitem.SubItems.Strings[2]:=copy(Llogrec[i],2,length(Llogrec[i])-1);
4: rowitem.SubItems.Strings[3]:=copy(Llogrec[i],2,length(Llogrec[i])-1);
5: rowitem.SubItems.Strings[4]:=copy(Llogrec[i],2,length(Llogrec[i])-1);
6: rowitem.SubItems.Strings[5]:=copy(Llogrec[i],2,length(Llogrec[i])-1);
end;
end;
end;
end;
finally
closefile(Flogfile);
end;
end;
var
Flogfile:textfile;
Slogrec:string;
Llogrec:Tstringlist;
i:integer;
rowitem:tlistitem;
begin
assignfile(Flogfile,'E:\系统\rizhi1.txt');
reset(Flogfile);
try
begin
while not eof(Flogfile) do
begin
readln(Flogfile,Slogrec);
Slogrec:=copy(Slogrec,3,length(Slogrec)-4);
Llogrec:=splitstring(Slogrec,'^');
rowitem:=self.ListView1.items.add;
for i:=0 to Llogrec.Count-1 do
begin
case strtoint(leftstr(Llogrec[i],1)) of
1: rowitem.SubItems.Strings[0]:=copy(Llogrec[i],2,length(Llogrec[i])-1);
2: rowitem.SubItems.Strings[1]:=copy(Llogrec[i],2,length(Llogrec[i])-1);
3: rowitem.SubItems.Strings[2]:=copy(Llogrec[i],2,length(Llogrec[i])-1);
4: rowitem.SubItems.Strings[3]:=copy(Llogrec[i],2,length(Llogrec[i])-1);
5: rowitem.SubItems.Strings[4]:=copy(Llogrec[i],2,length(Llogrec[i])-1);
6: rowitem.SubItems.Strings[5]:=copy(Llogrec[i],2,length(Llogrec[i])-1);
end;
end;
end;
end;
finally
closefile(Flogfile);
end;
end;
解决方案 »
- GZIP解压缩的问题,我用的是ZLIP,但总是报DATA ERROR的错误
- access报错,at address 1B0418EE in module 'msjet40.dll'
- 现在的网络游戏密码登录窗口,都是画出来的,用SPY++什么也查不到,请问下,对于画出来的“edit” 如何取得‘edit’里面的内容?
- 一道真正的智力题,据说是世界上目前最好的智力题目
- DELPHI 操作Excel表的问题,怎样引用数字合并字段?
- 一个声明时的小问题啊!请大家帮我看看啊!我是小菜!谢谢大家了啊!!!!!!
- 能不能告诉我一些纯免费的电影下载地址?
- 我的存储过程在查询分析器下可以运行,为什么通过DELPHI的ADOQUERY和ADOStoredProc要出现EOLEEXCEPTION的错误。(高手请帮忙,必有重谢)
- c to pascal问题,送100分!
- 救救我吧!我用ADO方法打开Access数据库,为什么他老要我输入用户名和密码!!!
- 在多线程里调用同一com提示"应用程序调用一个已为另一线程整理的接口"
- 关于string的赋值?
全部这样改
要用rowitem.SubItems.Addrowitem.SubItems.Strings[0]是用来取值的
还有就是我用 2: rowitem.SubItems.Strings[1]:=copy(Llogrec[i],2,length(Llogrec[i])-1);
本意是想将数据插入到第二列,如果用rowitem.SubItems.Add 好像不能实现,该怎么做呢
item:TListItem;
begin
item := ListView.Items.Add;
Item.Caption := 'aaaa';
Item.SubItems.Add('bbb');//第二列
Item.SubItems.Add('ccc');//第三列
Item.SubItems.Add('DDD');//第四列
end;