每打开一个文件就写注册表 inifile.writestring('inifile.ini','recent','xxxx');//xxx为你打开的文件路径 下次打开窗口时读注册表 recent:= inifile.readstring('inifile.ini','recent',''); if recent<>'' then Memo1.lines.loadFormFile(recent);
uses inifilesprocedure TForm1.Button1Click(Sender: TObject); var myfile:Tinifile; begin myfile:=Tinifile.Create(ExtractFilePath(Application.ExeName)+'test.ini'); myfile.readstring('test.ini','SectionName',''); end;
inifile.writestring('inifile.ini','recent','xxxx');//xxx为你打开的文件路径
下次打开窗口时读注册表
recent:= inifile.readstring('inifile.ini','recent','');
if recent<>'' then
Memo1.lines.loadFormFile(recent);
var
myfile:Tinifile;
begin
myfile:=Tinifile.Create(ExtractFilePath(Application.ExeName)+'test.ini');
myfile.readstring('test.ini','SectionName','');
end;