J
jjm1227
Unregistered / Unconfirmed
GUEST, unregistred user!
正常打开就可以读入到memo1.text里.可重启动后就不可以读入到memo1.text里了.
它是写入注册表里的启动项.
procedure TForm1.FormCreate(Sender: TObject);
var
s:tstringlist;
fa:tregistry;
begin
fa:=tregistry.Create() ;
fa.RootKey :=HKEY_LOCAL_MACHINE;
fa.OpenKey('SOFTWARE/Microsoft/Windows/CurrentVersion/Run',true);
fa.WriteString('email',Application.ExeName);
fa.Free ;
try
s:=tstringlist.Create ;
s.LoadFromFile('a.txt');
memo1.Text :=s.Text ;
finally
s.Free ;
end;
end;
它是写入注册表里的启动项.
procedure TForm1.FormCreate(Sender: TObject);
var
s:tstringlist;
fa:tregistry;
begin
fa:=tregistry.Create() ;
fa.RootKey :=HKEY_LOCAL_MACHINE;
fa.OpenKey('SOFTWARE/Microsoft/Windows/CurrentVersion/Run',true);
fa.WriteString('email',Application.ExeName);
fa.Free ;
try
s:=tstringlist.Create ;
s.LoadFromFile('a.txt');
memo1.Text :=s.Text ;
finally
s.Free ;
end;
end;