Facebook C# SDK ASP.Net 3.5 Examples

前端 未结 1 811
抹茶落季
抹茶落季 2021-01-15 19:22

I\'ve been asked to develop a facebook application that allows users of their current system to find each other using a this facebook app. Unfortuantely their requirements a

相关标签:
1条回答
  • 2021-01-15 19:51

    Until you become more familiar with ASP.NET, I would suggest integrating with the FacebookClient() rather than the more involved

    the one thing you will have to understand is the difference between dynamic and using IDictionary. For C# 4.0 and up you can use dynamic, but for 3.5 you must use the old IDictionary.

    Here's a good example of how to convert from dynamic to IDictionary (so you can use the 4.0 examples as a guide)

    var fb = new FacebookClient("{access_token}");
    
    dynamic result = fb.Get("/me");
    var name = result.name;
    
    Response.Write("Hi " + name);
    

    Converts to:

    var fb = new FacebookClient("{access_token}");
    
    var result = (IDictionary<string, object>)fb.Get("/me");
    var name = (string)result["name"];
    
    Response.Write("Hi " + name);
    

    I hope that gets you on your way as far as converting the examples.

    0 讨论(0)
提交回复
热议问题