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 + ")");
});