delphi TMS WEB core WebHttpRequest1 解析JSON


本文整理自网络,侵删。

 {"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 通过窗口标题结束进程

Delphi hash类

Delphi 获得每个进程的cpu使用率

Delphi 单击按钮左键弹起菜单

Delphi tthread中文注释

Delphi 10.3.1 android沉浸式透明状态栏

Delphi 不可移动的窗体

Delphi使用xmlhttp获取时间

Delphi中format函数的用法

Delphi 取控件下的图象

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...