且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

ASP.NET MVC的Facebook

更新时间:2022-12-14 23:25:01

这code是正确的,问题是,我没有将我的应用我的个人资料。阿呆想念,但我的想法是,整个事情是不良记录。我有离线访问另一个问题,但这是一个不同的职位。

This code was right, the problem was that I had not added my application to my profile. Dumb miss, but my thought is that the whole thing is poorly documented. I have another issue with offline access, but that is for a different post.

string apiKey = "XXXXXXXXX";
string apiSecret = "XXXXXXXXXXXX";
Facebook.Session.ConnectSession._connectSession = new Facebook.Session.ConnectSession(apiKey, apiSecret);
if (_connectSession.IsConnected)
{
    Facebook.Rest.Api api = new Facebook.Rest.Api(_connectSession);
    string response = api.Stream.Publish("Test", null, null, null, api.Users.Session.UserId);
}