frxJSON用法

frxJSON: TfrxJSON;

frxJSONArrayT: TfrxJSONArray;

frxJSONtemp : TfrxJSON;

begin

S := TStringList.Create;

try

S.LoadFromFile('E:\JSON.txt');

finally

Res:= S.Text; //utf8DEcode( )

FreeAndNil(S);

end;

frxJSON := TfrxJSON.Create(Res);

if frxJSON.IsValid then

frxJSONArrayT := TfrxJSONArray.Create(frxJSON.ObjectByName('Detail'));

frxJSONtemp :=TfrxJSON.CreateWeek(frxJSON.ObjectByName('Main'));

Memo1.Lines.Add('Addr:'+frxJSONtemp.ValueByName('Addr'));

for i:= 0 to frxJSONArrayT.Count-1 do

begin

frxJSONtemp:=frxJSONArrayT.Get(i);

self.Memo1.Lines.Add(frxJSONtemp.ValueByName('FMaterialCode'));

self.Memo1.Lines.Add(frxJSONtemp.ValueByName('FMaterialName'));

self.Memo1.Lines.Add(frxJSONtemp.ValueByName('FColorName'));

self.Memo1.Lines.Add(frxJSONtemp.ValueByName('FSizeName'));

self.Memo1.Lines.Add(frxJSONtemp.ValueByName('FNum'));

self.Memo1.Lines.Add(frxJSONtemp.ValueByName('FPrice'));

self.Memo1.Lines.Add(frxJSONtemp.ValueByName('FMoney'));

self.Memo1.Lines.Add(frxJSONtemp.ValueByName('FRemark'));

end;

{

"Main":

{

"Title":"主表",

"Client":"客户:上海李明",

"Storge":"仓库:档口仓库",

"Addr":"送货地址:上海人民广场路37弄21号",

"TotalNum":40,

"TotalMoney":1500

},

"Detail":

{ "FMaterialCode":"aaaA", "FColorName":"红", "FSizeName":"M", "FNum":10, "FPrice":30, }, { "FMaterialCode":"款号A", "FColorName":"黄", "FSizeName":"M", "FNum":10, "FPrice":30, }

}

相关推荐
Want59510 分钟前
C/C++圣诞树①
c语言·开发语言·c++
tuokuac29 分钟前
nginx配置前端请求转发到指定的后端ip
前端·tcp/ip·nginx
程序员爱钓鱼32 分钟前
Go语言实战案例-开发一个Markdown转HTML工具
前端·后端·go
Kt&Rs1 小时前
MySQL复制技术的发展历程
数据库·mysql
小小菜鸡ing1 小时前
pymysql
java·服务器·数据库
手握风云-1 小时前
MySQL数据库精研之旅第十六期:深度拆解事务核心(上)
数据库·mysql
万少1 小时前
鸿蒙创新赛 HarmonyOS 6.0.0(20) 关键特性汇总
前端
还有多远.1 小时前
jsBridge接入流程
前端·javascript·vue.js·react.js
蝶恋舞者1 小时前
web 网页数据传输处理过程
前端
非凡ghost1 小时前
FxSound:提升音频体验,让音乐更动听
前端·学习·音视频·生活·软件需求