procedure TForm1.Button1Click(Sender: TObject);
var
DelphiIni: TIniFile;
begin
DelphiIni := TIniFile.Create('c:/windows/delphi32.ini');
Memo1.Clear;
DelphiIni.ReadSectionValues('Transfer', Memo1.Lines);
if Memo1.Lines.Values['Title1'] <> 'Picture Painter' then
DelphiIni.WriteString('Transfer', 'Title1', 'Picture Painter');
DelphiIni.Free;
end;
procedure TForm1.Button2Click(Sender: TObject);
var
DelphiIni: TIniFile;
begin
DelphiIni := TIniFile.Create('c:/windows/delphi32.ini');
{ if the entry wasn抰 there before, delete it now }
if Memo1.Lines.Values['Title1'] = '' then
DelphiIni.DeleteKey('Transfer', 'Title1')
{ otherwise, restore the old value }
else
DelphiIni.WriteString('Transfer', 'Title1',
Memo1.Lines.Values['Title1']);
DelphiIni.Free;
end;