using System; using System.Collections.Generic; using Newtonsoft.Json;

public class Program { public static void Main(string[] args) { string json = @" { ""format"":""json"", ""isnew"":false, ""membername"":null, ""memberid"":null, ""memo"":""不想要了"", ""method"":""ome.refund.add"", ""money"":""20"", ""node id"":""1808165934"", ""order bn"":""170823210481717"", ""pay_type"":""online"", ""refund bn"":""20091110005"", ""refund_type"":""apply"", ""status"":""0"", ""refundamount"":199.11, ""t_ready"":""2017-09-11 11:17:44"", ""t sent"":""2017-09-11 11:17:44"", ""timestamp"":""2017-09-12 11:17:44:182739"", ""trade no"":""2017083121001001030288947070"", ""v"":""1.0"", ""sign"":""20449399271C98727AFFBA070A0FE30E"" }";

    Dictionary<string, string> dictionary = JsonConvert.DeserializeObject<Dictionary<string, string>>(json);

    foreach (KeyValuePair<string, string> kvp in dictionary)
    {
        Console.WriteLine("Key: " + kvp.Key + ", Value: " + kvp.Value);
    }
}
写一段C#代码把下面的Json转为Dictionarystring string formatjson isnewfalse membernamenull memberidnull memo不想要了 methodomerefundadd money20 node id1808165934 order bn170823210481717 p

原文地址: https://www.cveoy.top/t/topic/iERz 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录