0

如何将其转换为在 .NET 3.5 中工作?它由于某种原因无法编译...抱怨“myInfo.data”缺少 .NET 4.0 中使用的 Microsoft CSharp 参考。

var auth = new CanvasAuthorizer { Perms = "user_about_me,friends_about_me" };

if (auth.Authorize())
{
    var fb = new FacebookClient(auth.Session.AccessToken);
    dynamic myInfo = fb.Get("/me/friends");
    foreach (dynamic friend in myInfo.data  )
    {
        Response.Write("Name: " + friend.name + "<br/>Facebook id: " + friend.id + "<br/><br/>");
    }
}
4

1 回答 1

1

大概是:

var auth = new CanvasAuthorizer { Perms = "user_about_me,friends_about_me" };

if (auth.Authorize())
{
    var fb = new FacebookClient(auth.Session.AccessToken);
    MyInfoType myInfo = (MyInfoType)fb.Get("/me/friends");
    foreach (var friend in myInfo.data)
    {
        Response.Write("Name: " + friend.name + "<br/>Facebook id: " + friend.id + "<br/><br/>");
    }
}

什么类型的 fb.Get 返回?

于 2013-01-21T03:13:16.367 回答