我正在使用以下代码获取json(objArr)对象:
var objArr = (object[])record.Value;
运行时的代码如下:
我可以通过以下循环列出属性:
foreach (var obj in objArr)
{
foreach(var item in (Dictionary<string, object>)obj)
{
}
}
但是我想直接从objArr
答案 0 :(得分:1)
根据您的本体规格进行尝试
JavaScriptSerializer js = new JavaScriptSerializer();
BlogSites blogObject = js.Deserialize<BlogSites>(jsonData);
string name = blogObject.Name;
string description = blogObject.Description;
// Other way to whithout help of BlogSites class
dynamic blogObject = js.Deserialize<dynamic>(jsonData);
string name = blogObject["Name"];
string description = blogObject["Description"];
您可以参考this