lazarus json
uses fpjson, jsonparser function jsonArray(json: string): tjsonarray; begin result := getjson(json) as tjsonarray; end; function jsonObject(json: string): tjsonobject; begin result := getjson(json) as tjsonobject; end; function jsonFromFile(filename: string): tjsonobject; var sl: TStringList; begin sl := TStringList.Create; try sl.LoadFromFile(filename); Result := getjson(sl.Text) as tjsonobject; finally sl.Free; end; end; var jo: tjsonobject; var ja: tjsonarray; jo.add(); jo.get(); ja := jo.Find('dataset') as tjsonarray;
for i := 0 to ja.Count - 1 do
jo := ja.Items[i] as tjsonobject;
本文来自博客园,作者:{咏南中间件},转载请注明原文链接:https://www.cnblogs.com/hnxxcxg/p/18276632