我试图让SkyDrive上登录的用户的所有文件夹的列表。
LiveOperationResult operationResult = await client.GetAsync("me/skydrive/files");
dynamic result = operationResult.Result;
我希望能够做这样的事情:
Dictionary<string, object> folderData = (Dictionary<string, object>)result;
List<object> folders = (List<object>)folderData["data"];
foreach (object item in folders)
{
Dictionary<string, object> folder = (Dictionary<string, object>)item;
if (folder["name"].ToString() == "Folder Name")
{
showToastMessage(folder["id"].ToString());
return;
}
}
然而,在这条线:
Dictionary<string, object> folderData = (Dictionary<string, object>)result;
我发现了一个错误:
无法将类型“System.Dynamic.DynamicObject”到“System.Collections.Generic.Dictionary”
没有人有任何想法,我该怎么办解决此问题得到什么?