0
String zohoResponse = @"
[
{
'Title':'Mr.',
'First Name':'ram',
'Last Name':'chang',
'Employed at Trade Client Name':'mile travel',
'Telephone':'657498333',
'E-mail':'[email protected]',
'Fax':' ',
'Street':'123 Street',
'City':'Winnipeg',
'State/Province':'Manitoba',
'Country':'Canada',
'Postcode':'R4T 600',
'Agent ID':70,
'Primary Sales Agent':' ',
'Employed at From':'09/12/2008',
'Employed at To':'09/12/2028'
}
]
";
dynamic jsonObj = JsonConvert.DeserializeObject(zohoResponse);
xmlData = new XDocument(
`enter code here` new XElement("Leads",
new XElement("row", new XAttribute("no", "1"),
new XElement("FL", new XAttribute("val", "Lead Source"), jsonObj["Last Name"]),
new XElement("FL", new XAttribute("val", "Title"), jsonObj["First Name"])
)));
我想檢索動態索引值。我已經使用新如何從動態對象索引檢索值
的XElement( 「FL」,新XAttribute( 「VAL」, 「標題」), jsonObj.GetType()的getProperty( 「標題」)。的GetValue(jsonObj,NULL)) 但我依索引檢索值仍然異常