delphi inifile的 readsection 和 
readsectionvalues 的用法  请举个简单易懂的小实例说明  谢谢!

解决方案 »

  1.   

    看帮助了,帮助里面有例子的The following example reads information from a file into three listboxes on a form.uses IniFiles;
    procedure TForm1.FormActivate(Sender: TObject);var
      AppIni: TIniFile;
    begin
      AppIni := TIniFile.Create('win.ini');
      AppIni.ReadSections(ListBox1.Items);
      AppIni.ReadSection('Ports',Listbox2.Items);
      AppIni.ReadSectionValues('Ports',ListBox3.Items);
      AppIni.Free;
    end;
      

  2.   

    http://blog.csdn.net/bdmh/article/details/4147104
      

  3.   

    更高级的理解是看源码,我解释通俗点,比如ini文件格式是:[K1]
    A=123
    B=234
    [K2]
    C=xxx
    D=yyyprocedure ReadSections(Strings: TStrings);
    取出K1,K2添加到Strings中procedure ReadSection (const Section: String; Strings: TStrings);
    取出Section项中的Key值添加到Strings中,比如Section=K2,则Strings结果是C,Dprocedure ReadSectionValues(const Section: String; Strings: TStrings);
    取出Section项中的Key+Value值添加到Strings中,比如Section=K1,则Strings结果是A=123,B=234