<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          LitJSONC#的JSON開發(fā)包

          聯(lián)合創(chuàng)作 · 2023-09-21 22:18

          LitJSON 是一個(gè)小型快速的用于處理 JSON 格式數(shù)據(jù)的 C# 和 .NET 的開發(fā)包。

          示例代碼:

          using LitJson;
          using System;
          
          public class Person
          {
              // Person members are defined here ...
          }
          
          public class JsonSample
          {
              public static void Main ()
              {
                  PersonToJson ();
                  JsonToPerson ();
              }
          
              public static void PersonToJson ()
              {
                  Person bill = new Person ();
          
                  bill.Name = "William Shakespeare";
                  bill.Age  = 51;
                  bill.Birthday = new DateTime (1564, 4, 26);
          
                  string json_bill = JsonMapper.ToJson (bill);
          
                  Console.WriteLine (json_bill);
                  // {"Name":"William Shakespeare","Age":51,"Birthday":"04/26/1564 00:00:00"}
              }
          
              public static void JsonToPerson ()
              {
                  string json = @"
                      {
                          ""Name""     : ""Thomas More"",
                          ""Age""      : 57,
                          ""Birthday"" : ""02/07/1478 00:00:00""
                      }";
          
                  Person thomas = JsonMapper.ToObject<Person> (json);
          
                  Console.WriteLine ("Thomas' age: {0}", thomas.Age);
                  // Thomas' age: 57
              }
          }
          
          瀏覽 16
          點(diǎn)贊
          評論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          評論
          圖片
          表情
          推薦
          點(diǎn)贊
          評論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  丁香五月激情视频 | 国产激情在线观看 | 国产成人麻豆精品午夜在线 | 目逼色在线视频 | 日韩欧美国产操 |