码迷,mamicode.com
首页 > Web开发 > 详细

json返回取值操作

时间:2014-09-09 15:23:28      阅读:195      评论:0      收藏:0      [点我收藏+]

标签:http   os   ar   sp   log   on   c   res   r   

   str:=‘http://127.0.0.1:8081/datasnap/rest/tprjmis/web_login/‘+AnsiToUtf8(用户名edit.Text)+‘/‘+ AnsiToUtf8(密码edit.text);    str:=AnsiToUtf8(用户名edit.Text);    str:=HTTPEncode(str);    str:=self.IdHTTP1.Get(‘http://127.0.0.1:8081/datasnap/rest/tprjmis/web_login/‘+httpencode(AnsiToUtf8(用户名edit.Text))+‘/‘+ HTTPEncode(AnsiToUtf8(密码edit.text)));

   json:=tjsonobject.Create;    json := TJSONObject.ParseJSONValue(TEncoding.UTF8.GetBytes(str), 0) as TJSONObject;    ja:=json.Getvalue(‘result‘) as tjsonarray;    json:=ja.Items[0] as tjsonobject;

   showmessage(json.ToString);    json:=json.Getvalue(‘user‘) as tjsonobject;    showmessage(json.ToString);    str:=json.GetValue(‘_id‘).ToString;    showmessage(str);

json返回取值操作

标签:http   os   ar   sp   log   on   c   res   r   

原文地址:http://www.cnblogs.com/HuiLove/p/3962349.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!