打开文件 assign
reset一下
定位到文件最后一行
readln
显示内容,
关闭文件
定时器在20s后重新启动上面的步骤
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls;
type
TForm1 = class(TForm)
Memo1: TMemo;
Timer1: TTimer;
procedure Timer1Timer(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Timer1Timer(Sender: TObject);
begin
memo1.Lines.LoadFromFile('1.txt');
end;
end.
assignfile
reset
repeat
read
sleep(20*1000);
until
closefile