Fórum Alterar arquivo INI #219217
09/03/2004
0
Ariovaldo
Curtir tópico
+ 0Posts
09/03/2004
Maicongabriel
Cria as chaves via programação? Se sim, para adicionar é da mesma forma! Procure do help do próprio Delphi, que lá tem exemplos! :?
Gostei + 0
09/03/2004
Ariovaldo
Gostei + 0
09/03/2004
Aroldo Zanela
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’t 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;Gostei + 0
10/03/2004
Maicongabriel
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)