简体   繁体   English

Facebook API入门

[英]Getting started Facebook API

i want to develop Desktop based application in wpf (c#). 我想在WPF(C#)中开发基于桌面的应用程序。 which will need option to login their facebook account too. 这也将需要选择登录他们的Facebook帐户。 so i have registered my app in fb developer site and download C# sdk with reference some stack overflow link. 所以我已经在fb开发人员站点中注册了我的应用程序,并通过引用一些堆栈溢出链接下载了C#SDK。 which always give connection failed 总是给连接失败

// code which i have used //我使用的代码

 string APIKey = ConfigurationManager.AppSettings["API_Key"];
    string APISecret = ConfigurationManager.AppSettings["API_Secret"];

Facebook.Session.ConnectSession connectsession = new Facebook.Session.ConnectSession(APIKey, APISecret);
if (connectsession.IsConnected())
            {
        Facebook.Rest.Api api = new Facebook.Rest.Api(connectsession);
        var friends = api.Friends.GetLists();
        foreach (var friend in friends)
        {
            System.Console.WriteLine(friend.name);
        }
}

some site telling that C# sdk is deprecated. 某个网站告知已弃用C#sdk。

http://developers.facebook.com/blog/post/624/ http://developers.facebook.com/blog/post/624/

Facebook Graph C# SDK Ver 6.0: Unable to create event on App's Page Facebook Graph C#SDK 6.0版:无法在应用页面上创建事件

please help me to start facebook api integration in my desktop based app using wpf. 请帮助我使用wpf在基于桌面的应用程序中启动facebook api集成。 some body asked to use graph api but i have doubt whether this will supprot for c# . 一些机构要求使用图形API,但我怀疑这是否会支持C#。 am struk to start my step on facebook integration. 是我开始我的Facebook整合步骤。

Graph Api is fully supported in C# because it is based on rest and you can call rest service through C# code, obviously url calling is different from method calling, In graph api you can call url and parse its response. C#完全支持Graph Api,因为它基于rest,您可以通过C#代码调用rest服务,显然url调用与方法调用不同。在graph api中,您可以调用url并解析其响应。 I would recommend to go with graph api, Facebook has not provided the C# SDK, its a open source library maintained by open source community, however graph api help is directly provided by Facebook. 我建议使用图api,Facebook没有提供C#SDK,它是一个由开源社区维护的开源库,但是图api的帮助直接由Facebook提供。

Check here and here to know how to call graph api through C# 在这里这里检查以了解如何通过C#调用图API

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM