本文整理自网络,侵删。
{"Result":"OK","Records":[{"id":504},{"id":505},{"id":534},{"id":535},{"id":536}]}
procedure TForm1.WebHttpRequest1Response(Sender: TObject; AResponse: string);var js: TJSON; ja: TJSONArray; jo: TJSONObject; i: integer;begin jo := js.Parse(AResponse);
ja := TJSONArray(jo.GetValue('Records'));
ShowMessage('Retrieved items:' +inttostr(ja.Count));
for i := 0 to ja.Count - 1 do begin jo := ja.Items[i]; WebListBox1.Items.Add(jo.GetJSONValue('id')); end; finally js.Free; end; end;
相关阅读 >>
Delphi实现获取文件及文件夹大小(支持超过2g的大文件)
Delphi 实现卸载windows应用程序(类似360软件管家-卸载程序)
Delphi程序在win7 win8 win10下自动请求以管理员身份运行
winapi 字符及字符串函数(13): lstrcmp、lstrcmpi - 对比串
Delphi strutils.leftstr、strutils.rightstr - 提取左右字符串
更多相关阅读请进入《Delphi》频道 >>