var f:tstringlist; f:=tstringlist.create; f.append(序列号); f.append(序列号); f.append(序列号); f.save(x.dat); 读取方法 f[i]
procedure TForm1.Button4Click(Sender: TObject); var f:textfile; aPath :string; s:string; begin aPath := 'c:\a.txt'; if fileExists(aPath) then begin AssignFile(f,aPath); Reset(f); while not eof(f) do begin readln(f,s); showmessage(s); end; closefile(f); end; end;
怎么写就怎么读~~
f:=tstringlist.create;
f.append(序列号);
f.append(序列号);
f.append(序列号);
f.save(x.dat);
读取方法
f[i]
var
f:textfile;
aPath :string;
s:string;
begin
aPath := 'c:\a.txt';
if fileExists(aPath) then
begin
AssignFile(f,aPath);
Reset(f);
while not eof(f) do
begin
readln(f,s);
showmessage(s);
end;
closefile(f);
end;
end;