如题?
举个简单的例子

解决方案 »

  1.   

    procedure TForm1.FormActivate(Sender: TObject);var
      MyIniFile: TIniFile;
    begin
      MyIniFile := TIniFile.Create('myapp.ini');
      with MyIniFile do
      begin
        if ReadBool('AutoLoad', 'FormProperties', False) = True then
        begin
          Visible := ReadBool('FormOptions', 'Visible', True);
          Color := TColor(ReadInteger('FormOptions', 'Color', clNormalBackground));
          Caption := ReadString('FormOptions', 'Caption', 'Main');
      end;
      MyIniFile.Free;end;
      

  2.   

    procedure TForm1.Button1Click(Sender: TObject);var
      MyIniFile: TIniFile;
      begin
      MyIniFile := TIniFile.Create('myapp.ini');
      Memo1.Clear;
      MyIniFile.ReadSectionValues('Transfer', Memo1.Lines);
      if Memo1.Lines.Values['Title1'] <> 'Picture Painter' then
        MyIniFile.WriteString('Transfer', 'Title1', 'Picture Painter');
      MyIniFile.Free;
    end;
      

  3.   

    谢谢 。我是新手,有点看不懂。
    我是想  读取 my.ini 里面的所有的节点添加到 listbox1 的列表里面。
      

  4.   

    system 就是小节名
      Ident  是变量
      v 是值
      iniFile := TiniFile.Create(extractfilepath(application.ExeName) + 'abc.ini');
      try
        v := inifile.ReadString('system', Ident, v);
      finally
        inifile.Free;
      end;