如何在c#中从JSON对象读取数据

时间:2017-05-20 07:19:38

标签: c# json

我有如下数据。我想阅读每个devicename。我该怎么读?

{
  "took": 1,
  "timed_out": false,
  "_shards": {
    "total": 5,
    "successful": 5,
    "failed": 0
  },
  "hits": {
    "total": 3,
    "max_score": 1,
    "hits": [
      {
        "_index": "devupdate",
        "_type": "driver",
        "_id": "2",
        "_score": 1,
        "_source": {
          "devicename": "UMBus Enumerator2",
          "driverversion": "6.1.7601.17514",
          "status": "",
          "InstallDate": "",
          "InfName": "umbus.inf"
        }
      },
      {
        "_index": "devupdate",
        "_type": "driver",
        "_id": "1",
        "_score": 1,
        "_source": {
          "devicename": "UMBus Enumerator",
          "driverversion": "6.1.7601.17514",
          "status": "",
          "InstallDate": "",
          "InfName": "umbus.inf"
        }
      },
      {
        "_index": "devupdate",
        "_type": "driver",
        "_id": "3",
        "_score": 1,
        "_source": {
          "devicename": "UMBus Enumerator3",
          "driverversion": "6.1.7601.17514",
          "status": "",
          "InstallDate": "",
          "InfName": "umbus.inf"
        }
      }
    ]
  }
}

0 个答案:

没有答案