0
如何獲取用戶的其他信息,如位置,生日或性別?我使用此代碼作爲我正在執行的項目的指南。 http://windowsphoneaalto.org/2012/01/facebook-get-information-about-the-user/C#(Windows Phone)Facebook獲取信息
我能夠獲得用戶的ID和姓名,但我無法獲得其他信息。我嘗試通過添加string location = result [「location」]來獲取用戶的位置。
我最終得到一個空值和一個keynotfoundexception。這是我遇到的一段代碼。
void _fbClient_GetCompleted(object sender, FacebookApiEventArgs e)
{
//Turn the data into Dictionary.
//If you want to see what the Facebook is returning you can check it
//with this tool provided by Facebook
//http://developers.facebook.com/tools/explorer/?method=GET&path=me
var result = (IDictionary<string, object>)e.GetResultData();
//Get the ID value
string id = result["id"].ToString();
//Get the name value
string name = result["name"].ToString();
//Currently the thread running this code
//is not the UI thread and only UI thread can update
//UI. So we are calling the UI thread here.
_page.Dispatcher.BeginInvoke(() => {
MessageBox.Show(name + " (" + id + ")");
});