久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<small id='kXxN7'></small><noframes id='kXxN7'>

    1. <legend id='kXxN7'><style id='kXxN7'><dir id='kXxN7'><q id='kXxN7'></q></dir></style></legend><tfoot id='kXxN7'></tfoot>

        <bdo id='kXxN7'></bdo><ul id='kXxN7'></ul>

      <i id='kXxN7'><tr id='kXxN7'><dt id='kXxN7'><q id='kXxN7'><span id='kXxN7'><b id='kXxN7'><form id='kXxN7'><ins id='kXxN7'></ins><ul id='kXxN7'></ul><sub id='kXxN7'></sub></form><legend id='kXxN7'></legend><bdo id='kXxN7'><pre id='kXxN7'><center id='kXxN7'></center></pre></bdo></b><th id='kXxN7'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='kXxN7'><tfoot id='kXxN7'></tfoot><dl id='kXxN7'><fieldset id='kXxN7'></fieldset></dl></div>

      1. 無法將當前 JSON 對象(例如 {“name":“value&qu

        Cannot deserialize the current JSON object (e.g. {quot;namequot;:quot;valuequot;}) into type #39;System.Collections.Generic.List`1(無法將當前 JSON 對象(例如 {“name:“value})反序列化為“System.Collections.Generic.List類型)
        <tfoot id='1z75U'></tfoot>

            <tbody id='1z75U'></tbody>

            <bdo id='1z75U'></bdo><ul id='1z75U'></ul>

                <small id='1z75U'></small><noframes id='1z75U'>

                <i id='1z75U'><tr id='1z75U'><dt id='1z75U'><q id='1z75U'><span id='1z75U'><b id='1z75U'><form id='1z75U'><ins id='1z75U'></ins><ul id='1z75U'></ul><sub id='1z75U'></sub></form><legend id='1z75U'></legend><bdo id='1z75U'><pre id='1z75U'><center id='1z75U'></center></pre></bdo></b><th id='1z75U'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='1z75U'><tfoot id='1z75U'></tfoot><dl id='1z75U'><fieldset id='1z75U'></fieldset></dl></div>

                1. <legend id='1z75U'><style id='1z75U'><dir id='1z75U'><q id='1z75U'></q></dir></style></legend>
                2. 本文介紹了無法將當前 JSON 對象(例如 {“name":“value"})反序列化為“System.Collections.Generic.List"類型的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  使用系統;使用 System.Collections.Generic;使用 System.Linq;使用 System.Text;使用臉書;使用 Newtonsoft.Json;命名空間臉書{課堂節目{靜態無效主要(字符串 [] 參數){var client = new FacebookClient(acc_ess);動態結果 = client.Get("fql", new { q = "select target_id,target_type from connection where source_id = me()"});字符串 jsonstring = JsonConvert.SerializeObject(result);//jsonstring {"data":[{"target_id":9503123,"target_type":"user"}]}列出<根對象>datalist = JsonConvert.DeserializeObject<List<RootObject>>(jsonstring);}公共類基準{公共 Int64 target_id { 獲取;放;}公共字符串目標類型 { 獲取;放;}}公共類 RootObject{公共列表<基準>數據{得到;放;}}}}

                  <塊引用>

                  無法反序列化當前 JSON 對象(例如 {"name":"value"})輸入類型'System.Collections.Generic.List`1[facebook.Program+RootObject]'因為該類型需要一個 JSON 數組(例如 [1,2,3])來反序列化正確.要修復此錯誤,請將 JSON 更改為 JSON 數組(例如 [1,2,3])或更改反序列化類型,使其成為正常的.NET 類型(例如,不是像整數這樣的原始類型,也不是集合類型如數組或列表)可以是

                  我看了其他帖子.

                  我的 json 看起來像這樣:

                  {"data":[{"target_id":9503123,"target_type":"user"}]}

                  解決方案

                  為了明確,除了@SLaks 的回答,這意味著你需要改變這一行:

                  Listdatalist = JsonConvert.DeserializeObject<List<RootObject>>(jsonstring);

                  到這樣的事情:

                  RootObject datalist = JsonConvert.DeserializeObject(jsonstring);

                  using System;
                  using System.Collections.Generic;
                  using System.Linq;
                  using System.Text;
                  using Facebook;
                  using Newtonsoft.Json;
                  
                  namespace facebook
                  {
                      class Program
                      {
                          static void Main(string[] args)
                          {
                              var client = new FacebookClient(acc_ess);
                              dynamic result = client.Get("fql", new { q = "select target_id,target_type from connection where source_id = me()"});
                              string jsonstring = JsonConvert.SerializeObject(result);
                  
                              //jsonstring {"data":[{"target_id":9503123,"target_type":"user"}]}
                              List<RootObject> datalist = JsonConvert.DeserializeObject<List<RootObject>>(jsonstring);
                          }
                  
                          public class Datum
                          {
                              public Int64 target_id { get; set; }
                              public string target_type { get; set; }
                          }
                  
                          public class RootObject
                          {          
                              public List<Datum> data { get; set; }
                          }
                      }
                  }
                  

                  Cannot deserialize the current JSON object (e.g. {"name":"value"}) into type 'System.Collections.Generic.List`1[facebook.Program+RootObject]' because the type requires a JSON array (e.g. [1,2,3]) to deserialize correctly. To fix this error either change the JSON to a JSON array (e.g. [1,2,3]) or change the deserialized type so that it is a normal .NET type (e.g. not a primitive type like integer, not a collection type like an array or List) that can be

                  I looked at other posts.

                  My json looks like this:

                  {"data":[{"target_id":9503123,"target_type":"user"}]}
                  

                  解決方案

                  To make it clear, in addition to @SLaks' answer, that meant you need to change this line :

                  List<RootObject> datalist = JsonConvert.DeserializeObject<List<RootObject>>(jsonstring);
                  

                  to something like this :

                  RootObject datalist = JsonConvert.DeserializeObject<RootObject>(jsonstring);
                  

                  這篇關于無法將當前 JSON 對象(例如 {“name":“value"})反序列化為“System.Collections.Generic.List"類型的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  Ignore whitespace while reading XML(讀取 XML 時忽略空格)
                  XML to LINQ with Checking Null Elements(帶有檢查空元素的 XML 到 LINQ)
                  Reading XML with unclosed tags in C#(在 C# 中讀取帶有未閉合標簽的 XML)
                  Parsing tables, cells with Html agility in C#(在 C# 中使用 Html 敏捷性解析表格、單元格)
                  delete element from xml using LINQ(使用 LINQ 從 xml 中刪除元素)
                  Parse malformed XML(解析格式錯誤的 XML)

                  <legend id='xQYP3'><style id='xQYP3'><dir id='xQYP3'><q id='xQYP3'></q></dir></style></legend>
                3. <tfoot id='xQYP3'></tfoot>
                    <tbody id='xQYP3'></tbody>

                        <bdo id='xQYP3'></bdo><ul id='xQYP3'></ul>

                          • <small id='xQYP3'></small><noframes id='xQYP3'>

                          • <i id='xQYP3'><tr id='xQYP3'><dt id='xQYP3'><q id='xQYP3'><span id='xQYP3'><b id='xQYP3'><form id='xQYP3'><ins id='xQYP3'></ins><ul id='xQYP3'></ul><sub id='xQYP3'></sub></form><legend id='xQYP3'></legend><bdo id='xQYP3'><pre id='xQYP3'><center id='xQYP3'></center></pre></bdo></b><th id='xQYP3'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='xQYP3'><tfoot id='xQYP3'></tfoot><dl id='xQYP3'><fieldset id='xQYP3'></fieldset></dl></div>
                          • 主站蜘蛛池模板: 一区二区三区在线免费观看 | 精品国产成人 | 欧美一区二区免费 | 玖玖在线免费视频 | 日本在线视频一区二区 | 天天综合久久 | 日日草夜夜草 | 亚洲成人精| 色偷偷噜噜噜亚洲男人 | 亚洲天堂av在线 | av电影一区二区 | 国产午夜精品久久久 | 国产精品亚洲一区二区三区在线 | 日韩在线精品视频 | 中文字幕 视频一区 | 国产色黄| 欧美中文字幕一区二区三区亚洲 | 国产精品欧美一区二区 | 久久爱综合 | 日本久久精品 | 欧美亚洲综合久久 | 成人精品一区亚洲午夜久久久 | 99久久婷婷国产综合精品电影 | 国产亚洲精品美女久久久久久久久久 | 国产成人精品一区二区三区网站观看 | 久久中文字幕一区 | 韩日在线观看视频 | 黄视频免费观看 | 久久精品免费 | 欧美日一区| 精品国产亚洲一区二区三区大结局 | 99久久久99久久国产片鸭王 | 精品国产第一区二区三区 | 亚洲色图综合 | 日批免费看 | 米奇7777狠狠狠狠视频 | 国产精品久久久久久久久久久久久 | 性一交一乱一伦视频免费观看 | 中文字幕在线观看精品 | 日韩视频精品在线 | 久久国产精品无码网站 |