如何使用JSON数据来获取输出 [英] How to use JSON data to get my output

查看:193
本文介绍了如何使用JSON数据来获取输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我正在尝试使用脸谱图API获取用户照片。当我发送查询和我的访问令牌时,我正在喷射JSON响应。那么我现在应该怎么做才能将响应转换为图片。以下是回复的部分





Hi,

I am trying to get the user photos using facebook graph API.I am jetting JSON response when I send query along with my access token. So what should I do now to convert that response into pictures. Here is the part of response


"id": "758607677542584",
   "name": "Hari Nakshatrala",
   "albums": {
      "data": [
         {
            "id": "111111111111",
            "from": {
               "id": "7584",
               "name": "xyz"
            },
            "name": "Profile Pictures",
            "link": "https://www.facebook.com/album.php?fbid=1030&id=75862584&aid=",
            "cover_photo": "701441",
            "privacy": "everyone",
            "count": 83,
            "type": "profile",
            "created_time": "2010-10-27T10:07:09+0000",
            "updated_time": "2014-09-11T04:51:51+0000",
            "can_upload": false
         },
         {
            "id": "2696",
            "from": {
               "id": "754",
               "name": "abc"
            },
            "name": "Cover Photos",
            "link": "https://www.facebook.com/album.php?fbid=296&id=75\&aid=58382",
            "cover_photo": "5011",
            "privacy": "everyone",
            "count": 24,
            "type": "cover",
            "created_time": "2012-02-12T04:06:14+0000",
            "updated_time": "2014-08-13T17:40:41+0000",
            "can_upload": false
         }

推荐答案

您可以尝试使用 Newtonsoft。 JSON [ ^ ]用于将此JSON语法反序列化为对象的API 。这将转换为匿名对象,以确保您获得一个您知道如何从中提取数据的对象。请创建在本网站内创建的课程, http://www.aspsnippets.com/Articles/Import-Facebook-Album-Photos-and-display-as-Image-Gallery-in-ASPNet.aspx [ ^ ] 。它包含用于为专辑和照片生成对象的类。
You can try using the Newtonsoft.JSON[^] API to deserialize this JSON syntax to an object. That would be converted into an anonymous object, to make sure you get an object that you know how to extract data from. Please create the classes created inside this website, http://www.aspsnippets.com/Articles/Import-Facebook-Album-Photos-and-display-as-Image-Gallery-in-ASPNet.aspx[^]. It contains the class used to generated an object for album and photos.


这篇关于如何使用JSON数据来获取输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆