1. 程式人生 > >安卓讀寫INI文件

安卓讀寫INI文件

form home bsp and onf fig count nil nal

安卓讀寫INI文件

uses System.IoUtils

procedure TForm1.Button1Click(Sender: TObject);
var
IniFile:TIniFile;
Count:Integer;
begin

try
IniFile:=TIniFile.Create(TPath.GetHomePath+‘\test.ini‘);
Count:=IniFile.ReadInteger(‘Config‘,‘Count‘,0);
Count:=Count+1;
IniFile.WriteString(‘sec‘, ‘TEL‘,‘ ‘);

IniFile.WriteInteger(‘Config‘,‘Count‘,Count);
finally
FreeAndNil(IniFile);
end;
end;

安卓讀寫INI文件