function TFmMain.ParseIPAddressFromTaoBaoJSON(const JSONStr: string; var country,
area, region, city: string): Boolean;
var
Obj: TJSONValue;
AValue: TJSONValue;
begin
Obj := TJSONObject.ParseJSONValue(JSONStr);
if Obj is TJSONObject then
begin
AValue := TJSONObject(Obj).Values['data'];
end;
if AValue is TJSONObject then
begin
country := TJSONObject(AValue).Values['country'].ToString;
area := TJSONObject(AValue).Values['area'].ToString;
region := TJSONObject(AValue).Values['region'].ToString;
city := TJSONObject(AValue).Values['city'].ToString;
end;
end;
---------------------
作者:pcplayer
来源:CSDN
原文:https://blog.csdn.net/pcplayer/article/details/80793709