How to create JSON-file in Delphi using SuperObject lib?

前端 未结 3 1433
轻奢々
轻奢々 2020-12-15 00:04

I\'m using Delphi 2010 and superobject library.

I have understand how to parse json-file, but I have no ideas how to create json?

The algor

3条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-15 00:40

    A very good library for that is the LkJson: http://sourceforge.net/projects/lkjson/

    To parse:

    var jsText : String; jsObj : TlkJSONobject; begin

    jsObj:=TlkJSON.ParseText(jsText) as TlkJSONobject;
    

    To convert it back into text:

    jsText := TlkJSON.GenerateText(jsObj);
    

提交回复
热议问题