-2
我在我的Facebook帐户上有粉丝页面。如何使用C#发布到Facebook粉丝页面的墙!
从asp Web应用程序发布定期更新到该页面的墙。它总是去我个人的Facebook帐户,而不是我的粉丝页面。
那么,我如何才能使其访问我的粉丝页面并发布呢?
这里是我的简单的代码...
protected void Page_Load(object sender, EventArgs e)
{
FaceBookConnect.API_Key = ConfigurationManager.AppSettings["FBAPIKey"];
FaceBookConnect.API_Secret = ConfigurationManager.AppSettings["FBAPISecret"];
if (!IsPostBack)
{
string code = Request.QueryString["code"];
if (!string.IsNullOrEmpty(code))
{
Dictionary<string, string> data = new Dictionary<string, string>();
data.Add("link", "string here");
data.Add("picture", "string here");
data.Add("caption", "string here");
data.Add("name", "string here");
data.Add("message", "string here");
FaceBookConnect.Post(code, "me/feed", data);
}
}
}
protected void btnPost_Click(object sender, EventArgs e)
{
FaceBookConnect.Authorize("publish_actions", ConfigurationManager.AppSettings["FBRedirectURL"]);
}
@Martha ASP是ASP经典的代名词。因此,当他们指ASP.net时,经常会有人选择ASP。我会重播。 – Dijkgraaf
您需要先获取页面访问令牌,然后使用它来发布帖子。 https://developers.facebook.com/docs/facebook-login/access-tokens#pagetokens – CBroe
@CBroe,你应该添加你的评论作为答案;)这正是这里的问题。 –