zoukankan      html  css  js  c++  java
  • delphi 解析Json格式(转自:http://blog.csdn.net/jayqiang/article/details/7066824)

    SuperObject 是开源的 Delphi 的 JSON 工具包,可生成 JSON 数据以及进行 JSON 解析。

    [delphi] view plaincopy
     
    1. unit Unit6;  
    2.   
    3. interface  
    4.   
    5. uses  
    6.   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,  
    7.   Dialogs, StdCtrls;  
    8.   
    9. type  
    10.   TForm6 = class(TForm)  
    11.     Button1: TButton;  
    12.     procedure Button1Click(Sender: TObject);  
    13.   private  
    14.     { Private declarations }  
    15.   public  
    16.   end;  
    17.   
    18. var  
    19.   Form6: TForm6;  
    20.   
    21. implementation  
    22.   
    23. uses superobject;  
    24.   
    25. {$R *.dfm}  
    26.   
    27. { TForm6 }  
    28.   
    29. procedure TForm6.Button1Click(Sender: TObject);  
    30. var  
    31.   vJson,vItem: ISuperObject;  
    32. begin  
    33.     vJson := SO('{"classname":"初二一班","pupils":[{"name":"张三","sex":"男"},{"name":"李四","sex":"女"}]}');  
    34.     ShowMessage(vJson['classname'].AsString);  
    35.     //开始遍历  
    36.     for vItem in vJson['pupils'do  
    37.     begin  
    38.        ShowMessage(vItem['name'].AsString);  
    39.        showMessage(vItem['sex'].AsString);  
    40.     end;  
    41. end;  
    42.   
    43. end.  


    SuperObject 下载地址:
    http://www.ctdisk.com/file/3537433

  • 相关阅读:
    将个人博客与github关联
    docker镜像制作
    perf命令
    vmstat命令
    ps命令
    top命令
    linux查看当前用户登陆信息
    .NET CORE应用程序启动
    WebAPI简介
    Redis-位图
  • 原文地址:https://www.cnblogs.com/mumble/p/3669049.html
Copyright © 2011-2022 走看看