5,379
社区成员
发帖
与我相关
我的任务
分享
var
lst : TStringlist;
begin
lst := Tstringlist.Create;
try
lst.loadfromFile('c:\a.txt'); //装载文件
lst.strings[0] := 'abc'; //改文件第一行的内容
lst.SaveToFile('c:\a.txt'); //保存文件
finally
lst.free;
end;
end;
var
i : Integer;
sCaption : s : string;
begin
//遍历Listview内容
for i := 0 to lst_tempList.Items.Count -1 do
begin
//读取内容
sCaption := lst_tempList.Items.Item[i].Caption
s := lst_tempList.Items.Item[i].SubItems.Text;
end;
end;