使用C#编辑Facebook帖子?

时间:2014-08-24 12:03:50

标签: c# facebook facebook-c#-sdk

我使用此代码发布到Facebook Feed:

 public string UploadPost(string intTitle, string inMessage, string inLinkCaption, int inLinkUrl, string inLinkDescription, string inLinkUrlPicture)
    {
        object obj;
        Facebook.JsonObject jsonObj;
        FacebookClient client;
        string access_token = ConfigurationManager.AppSettings["FacebookPageAccessToken"].ToString();

        client = new FacebookClient(access_token);

        var args = new Dictionary<string, object>();
        args["message"] = inMessage;
        args["caption"] = inLinkCaption;
        args["description"] = inLinkDescription;
        args["name"] = intTitle;
        args["picture"] = inLinkUrlPicture;
        args["link"] = inLinkUrl;

        if((obj = client.Post("/" + ConfigurationManager.AppSettings["FacebookPageId"].ToString() + "/feed", args)) != null)
        {
            if((jsonObj = obj as Facebook.JsonObject) != null)
            {
                if(jsonObj.Count > 0)
                    return jsonObj[0].ToString();
            }
        }

        return string.Empty;
    }

使用prev方法的帖子ID创建后是否可以编辑此帖子,或者我是否必须删除它并将其作为新帖子发布?

1 个答案:

答案 0 :(得分:0)

您无法编辑现有帖子,您必须删除现有帖子并发布新帖子。 See Facebook documentation link