0

{"result":1,"message":"客户端应用已加载","extras":{"jobs":{"5":{"jobName":"Ford Otomobil Afi\u015fi","jobMaxIdleTime":"2060 ","jobMaxTime":"2040"}},"customers":{"8":"Seker LTD"}}}

public class Extras
        {
            public string loginID { get; set; }
            public string loginToken { get; set; }
            public string employeesNameSurname { get; set; }
            public string employeesLanguage { get; set; }

            public Dictionary<string, string> jobs { get; set; }
            public Dictionary<string, string> customers { get; set; }

        }

 public class Dict
        {
            public int result { get; set; }
            public string message { get; set; }
            public Extras extras { get; set; }

        }

公共词典工作{得到; 放; } // 错误

我无法从“工作”中获取数据

4

2 回答 2

4

关于这个有一个类似的帖子。看看这对你有没有帮助。

于 2013-01-26T18:41:55.877 回答
1
    using System;
using Newtonsoft.Json;

namespace {

    [Serializable]
     class  {

        public int Result;
        public string Message;
        public Extras Extras;

        //Empty Constructor
        public (){}

        public string Serialize()
        {
            return JsonConvert.SerializeObject(this);
        }
        public static  FromJson(string json)
        {
            return JsonConvert.DeserializeObject<>(json);
        }
    }


    [Serializable]
     class 5 {

        public string JobName;
        public string JobMaxIdleTime;
        public string JobMaxTime;

        //Empty Constructor
        public 5(){}

    }


    [Serializable]
     class Jobs {

        public 5 5;

        //Empty Constructor
        public Jobs(){}

    }


    [Serializable]
     class Customers {

        public string 8;

        //Empty Constructor
        public Customers(){}

    }


    [Serializable]
     class Extras {

        public Jobs Jobs;
        public Customers Customers;

        //Empty Constructor
        public Extras(){}

    }

}
于 2013-01-26T18:40:20.907 回答