2011-03-08 72 views
1

使用c#或vb.net如何獲取專輯ID列表?我可以得到JSONObject但是不知道如何提取ID。獲取專輯列表facebook c#sdk

這是據我得到VB

Dim fbApp = New FacebookClient(accessToken.Text) 
Dim albums = DirectCast(fbApp.[Get]("me/albums"), IDictionary(Of String, Object)) 

我怎樣才能得到公正的專輯ID添加到一個新的數組?

回答

1

我沒有進入VB,所以你可以在C#中做些什麼,你可以通過VB自己想象。

這工作在C#

//Get the album data 
dynamic albums = app.Get("me/albums"); 
foreach(dynamic albumInfo in albums.data) 
{ 
    //Get the Pictures inside the album this gives JASON objects list that has photo attributes 
    // described here http://developers.facebook.com/docs/reference/api/photo/ 
    dynamic albumsPhotos = app.Get(albumInfo.id +"/photos"); 
} 
+0

我能得到什麼的accessToken? ** var app = new FacebookClient(accessToken.Text); ** – Kiquenet 2014-11-13 18:45:37