2011-03-13 114 views
0

我已经得到了下列(工作)代码,它返回所有我(当前用户)朋友的列表。 我现在想获得他们的公开个人资料照片。这是如何完成的?(Facebook的C#SDK)获取朋友个人资料图片

 var authorizer = new Authorizer(); 

     if (authorizer.IsAuthorized()) 
     { 
      if (authorizer.Session != null) 
      { 
       var token = authorizer.Session.AccessToken; 

       if (!string.IsNullOrEmpty(token)) 
       { 
        var client = new FacebookClient(token); 
        dynamic me = client.Get("me"); 
        string firstName = me.first_name; 
        string lastName = me.last_name; 

        dynamic myInfo = client.Get("/me/friends"); 
        if (myInfo != null) 
        { 
         foreach (dynamic friend in myInfo.data) 
         { 
          Response.Write("Name: " + friend.name + "<br/>Facebook id: " + friend.id + "<br/><br/>"); 
         } 
        } 

       } 
      } 
     } 

// Nicke

+1

这是做这件事: Nicke 2011-03-13 15:54:17

回答

相关问题