Edit2:TEdit;
Label1:TLabel;
Label2:TLabel;
Timer1:TTimer;
Label3:TLabel;
procedureFormCreate(Sender:TObject);
procedureFormDestroy(Sender:TObject);
procedureTimer1Timer(Sender:TObject);
private
{Privatedeclarations}
public
{Publicdeclarations}
end;
var
Form1:TForm1;
implementation
var
myinifile:TInifile;
{$R*.DFM}
procedureTForm1.FormCreate(Sender:TObject);
var
filename:string;
begin
filename:=ExtractFilePath(paramstr(0))+''myini.ini'';
myinifile:=TInifile.Create(filename);
edit1.Text:=myinifile.readstring
(''程序参数''
''用户名称''
''缺省的用户名称'');
edit2.text:=inttostr(myinifile.readinteger
(''程序参数''
''已运行时间''
0));
checkbox1.Checked:=myinifile.readbool
(''程序参数''
''是否正式用户''
False);
end;
procedureTForm1.FormDestroy(Sender:TObject);
begin
myinifile.writestring(''程序参数''
''用户名称''
edit1.Text);
myinifile.writeinteger(''程序参数''
''已运行时间''
strtoint(edit2.text));
myinifile.writebool(''程序参数''
''是否正式用户''
checkbox1.Checked);
myinifile.Destroy;
end;
procedureTForm1.Timer1Timer(Sender:TObject);
begin
edit2.Text:=inttostr(strtoint(edit2.text)+1);
end;
end.
程序在Pwin95、Delphi3下调试通过。