开发者

How to send message to facebook using ASP.NET 3.5 and C#

How to send messages to facebook users using ASP.NET? I need to send me开发者_StackOverflow中文版ssages and images to the Users. I have the Email Id and user authentication keys also if needed. Please try to give some code snippet to implement this one.


Using the Facebook C# SDK (http://facebooksdk.codeplex.com)

var app = new FacebookApp("access_token");
var parameters = new Dictionary<string, object>();
parameters["message"] = "This is a test message";
app.Api("/me", parameters, HttpMethod.Post);

That will post a message to the current user's wall. You can also post images using that SDK. There are samples in the tests on how to do that. Note, if you meant that you wanted to sent them a private message rather than post on their wall that is not possible. Facebook does not allow applications to send messages directly to users.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜