第一下载从https://github.com/barans/FacebookCsharpSdk
的NuGet包或DLL填补www.facebook.com/developers
var config = new Dictionary<string, object>();
config.Add("appId", "3955.......");
config.Add("secret", "4c1d...............");
config.Add("fileUpload", true); //optional
FacebookClient client = new FacebookClient(config);
此代码检索访问令牌 client.getAccessToken()的APPID和秘密;
该代码检索公开可用的当前用户信息。你可以用Facebook的帐号,如“999999”
client.api("/me", "GET", null));
的Facebook取代我不允许服务器侧壁发布到任意用户。你只能发布到当前用户的墙上,首先你应该询问publish_stream权限。得到这段代码后,使墙壁张贴
request.Method = FacebookApiMethodType.POST;
request.Path = "/me/feed";
request.Params = new NameValueCollection();
request.Params.Add("link", "www.arcademonk.com");
request.Params.Add("message", "C# SDK Batch Request Messsage");
你可以找到github页面上的所有文档。希望能帮助到你。
这篇文章可以帮助:http://www.thepcwizard.in/2013/02/working-with-facebook-c--sharp-sdk.html – ThePCWizard 2013-04-08 12:56:59