{"110101001":"东华门街道","110101002":"景山街道","110101003":"交道口街道","110101004":"安定门街道","110101005":"北新桥街道","110101006":"东四街道","110101007":"朝阳门街道","110101008":"建国门街道","110101009":"东直门街道","110101010":"和平里街道","110101011":"前门街道","110101012":"崇文门外街道","110101013":"东花市街道","110101014":"龙潭街道","110101015":"体育馆路街道","110101016":"天坛街道","110101017":"永定门外街道"}
象这种情况 Field不定的情况 用以下方法处理:
procedure TForm1.btn2Click(Sender: TObject);
var
sname: string;
sjson: ISuperObject;
sfirst, stemp: TSuperObjectIter;
begin
sname := edt1.Text;
mmo1.Lines.LoadFromFile(sname, TEncoding.UTF8);
sjson := SO(mmo1.Text);
mmo1.Clear;
if superobject.ObjectFindFirst(sjson, sfirst) then
begin
mmo1.Lines.Add(sfirst.key + ':' + sjson[sfirst.key].AsString);
stemp := sfirst;
while ObjectFindNext(stemp) do
begin
mmo1.Lines.Add(stemp.key + ':' + sjson[stemp.key].AsString);
end;
end;
end;