这是json字符串:
{"d":[{"numberOfRowsAdded":"26723"}]}

string json = DAO.getUploadDataSummary();
JObject uploadData = JObject.Parse(json);
string array = (string)uploadData.SelectToken("d");

如何更改代码以读取'numberOfRow Transactions中的值?

最佳答案

JObject uploadData = JObject.Parse(json);
int rowsAdded = Convert.ToInt32((string)uploadData["d"][0]["numberOfRowsAdded"])

关于c# - JObject如何读取数组中的值?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/15184430/

10-12 18:49