delphi inifile,该怎么处理
delphi inifile
------解决方案--------------------
看帮助了,帮助里面有例子的
- Delphi(Pascal) code
delphi inifile的 readsection 和 readsectionvalues 的用法
------解决方案--------------------
看帮助了,帮助里面有例子的
- Delphi(Pascal) code
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;
------解决方案--------------------
------解决方案--------------------
http://blog.****.net/bdmh/article/details/4147104
------解决方案--------------------
更高级的理解是看源码,我解释通俗点,比如ini文件格式是:
[K1]
A=123
B=234
[K2]
C=xxx
D=yyy
procedure ReadSections(Strings: TStrings);
取出K1,K2添加到Strings中
procedure ReadSection (const Section: String; Strings: TStrings);
取出Section项中的Key值添加到Strings中,比如Section=K2,则Strings结果是C,D
procedure ReadSectionValues(const Section: String; Strings: TStrings);
取出Section项中的Key+Value值添加到Strings中,比如Section=K1,则Strings结果是A=123,B=234
------解决方案--------------------