Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/337.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
将json反序列化到字典<;字符串,字符串>;在C#应用中_C#_.net_Json.net_Json Deserialization - Fatal编程技术网

将json反序列化到字典<;字符串,字符串>;在C#应用中

将json反序列化到字典<;字符串,字符串>;在C#应用中,c#,.net,json.net,json-deserialization,C#,.net,Json.net,Json Deserialization,我有这门课: public class ParseJson { private HttpClient _client; public ParseJson() { _client = new HttpClient(); } public async Task<List<Calibration>> LoadJsonAsync() {

我有这门课:

public class ParseJson
    {
        private HttpClient _client;

        public ParseJson()
        {
            _client = new HttpClient();
        }
        public async Task<List<Calibration>> LoadJsonAsync()
        {
            using (StreamReader r = new StreamReader("Json\\calibration.json"))
            {
                string responseString = r.ReadToEnd();
                Console.WriteLine("responseString: " + responseString);

                try
                {
                    var values = JsonConvert.DeserializeObject<Dictionary<string, string>>(responseString);
                
                    if ((values["DataType"]).Equals("Calibration_Symptoms"))
                    {

                        calibrationClass.CalibrationData(values: values);

                        }
                    }
                catch (Exception e)
                {
                    Console.WriteLine("Json Exception: " + e);
                }


                List<Calibration> items = JsonConvert.DeserializeObject<List<Calibration>>(responseString);
                return items;
            }
        }
    }

我将其更改为
var values=JsonConvert.DeserializeObject(responseString)

一切正常吗?只需继续搜索即可: