For Android, set the Remote Path to assets\internal
For iOS, set the Remote Path to StartUp\Documents
// XE3 : DBJSON
// Seattle: System.JSON
var
LJsonArr : TJSONArray;
LJsonValue : TJSONValue;
LItem : TJSONValue;
begin
memo1.Lines.Clear;
LJsonArr := TJSONObject.ParseJSONValue(TEncoding.utf8.GetBytes(memo2.Lines.Text),0) as TJSONArray;
for LJsonValue in LJsonArr do
begin
for LItem in TJSONArray(LJsonValue) do
memo1.lines.add(Format('%s : %s',[TJSONPair(LItem).JsonString.Value, TJSONPair(LItem).JsonValue.Value]));
memo1.Lines.Add('');
end;
end;
VAR SYSINI: TMemIniFile; // 讀取utf8格式的ini需使用TMemIniFile
ts:tstringlist;
i:integer;
ApplicationPath:string;
begin
// 先取得目前執行路徑
ApplicationPath := ExtractFilePath(Application.exename);
if ApplicationPath[length(ApplicationPath)] = ‘\’ then
begin
ApplicationPath := copy(ApplicationPath, 1, length(ApplicationPath) – 1);
end;
// 讀取sys.ini裡的memberid區塊並顯示值
MEMO1.Lines.Clear;
ts:=tstringlist.Create;
SYSini := TMemIniFile.Create(ApplicationPath+’\sys.ini’,TEncoding.UTF8);
if NOT (SYSini = nil) then begin
sysini.ReadSection(‘memberid’,ts);
for I:=0 TO TS.Count-1 DO BEGIN
MEMO1.Lines.Add(TS[I]);
MEMO1.LINES.Add(sysini.ReadString(‘MEMBERID’,TS[I],”));
END;
end;
ts.Free;
end;