Autor Beitrag
fuba
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 125

Win7
D7 Ent.
BeitragVerfasst: Mi 30.05.07 17:42 
hi leute

mal ne frage:

Ist es Irgendwie möglich eine INI-File in den speicher zu laden (wie eine Text-File mit TStringList) und diese da zu bearbeiten?

Sozusagen nicht dierekt die werte der INI-File zu ändern, sondern diese erstmal im Speicher zu bearbeiten und dann per UPDATE befehl oder ähnlich zu aktualisieren?
jakobwenzel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: Mi 30.05.07 17:46 
Guck dir mal Suche in: Delphi-Forum, Delphi-Library TMEMINIFILE an.

_________________
I thought what I'd do was, I'd pretend I was one of those deaf-mutes.
fuba Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 125

Win7
D7 Ent.
BeitragVerfasst: Mi 30.05.07 18:23 
Nice!

Danke, damit funzts!

Falls das noch wer braucht, ich habs so gemacht:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
var
  MIni: TMemIniFile;
  TL: TStringList;
begin

  TL := TStringList.Create;
  TL.LoadFromFile(aFile);  // "aFile" steht hier für die INI-File

  MIni := TMemIniFile.Create('');
  with MIni do
  begin
    SetStrings(TL);
    WriteString('Section', 'Ident', Edit1.Text);
    GetStrings(TL);
  end;
  TL.SaveToFile(aFile);
  TL.Free;

end;