var fText:TextFile; strLine:String; begin YourList.Clear; AssignFile(fText,'C:\..\AAA.Txt'); Reset(fText); while not Eof(fText) do begin Readln(fText,strLine); strLine:=Trim(strLine); YourList.Items.Add(strLine); end; CloseFile(fText); end;
readln啊……var tfile:textfile; s:string; begin AssignFile(tfile,'d:\???.txt'); reset(tfile); try while not eof(tfile) do begin readln(tfile,s); ListBox.Items.Append(s); end; finaly closefile(tfile); end; end;
fText:TextFile;
strLine:String;
begin
YourList.Clear;
AssignFile(fText,'C:\..\AAA.Txt');
Reset(fText);
while not Eof(fText) do
begin
Readln(fText,strLine);
strLine:=Trim(strLine);
YourList.Items.Add(strLine);
end;
CloseFile(fText);
end;
tfile:textfile;
s:string;
begin
AssignFile(tfile,'d:\???.txt');
reset(tfile);
try
while not eof(tfile) do
begin
readln(tfile,s);
ListBox.Items.Append(s);
end;
finaly
closefile(tfile);
end;
end;