如何获得ini文件里的一个小节的所有关键字名称....(20分)

  • 主题发起人 主题发起人 huitian
  • 开始时间 开始时间
H

huitian

Unregistered / Unconfirmed
GUEST, unregistred user!
如何获得ini文件里的一个小节的所有关键字名称....
 
你搜一下吧。 太多了。
 
Reads all the key names from a specified section of an INI file into a string list.

Delphi syntax:

procedure ReadSection (const Section: String; Strings: TStrings); override;

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;
 
myinifile.readsections(TStrings变量);可将INI文件中所有小节名读
取至一个字符串列表变量中去。

myinifile.readsectionvalues('小节名',TStrings变量);可将INI文件
中指定小节的所有行(包括关键字、=、值)读取至一个字符串列表变
量中去。
 
多人接受答案了。
 
后退
顶部