在Facebook墙上发布状态并上传照片。 [英] Post status and upload photo on Facebook wall.

查看:89
本文介绍了在Facebook墙上发布状态并上传照片。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

先生,我想使用我的aspx webform在我的Facebook墙上发布状态和照片。我正在尝试一些代码,但都是错误的。



我尝试了什么:



Sir, i want to post status and photo on my facebook wall using my aspx webform. i am trying some codes but all are gives an error.

What I have tried:

protected void Page_Load(object sender, EventArgs e)
   {
       FaceBookConnect.API_Key = "xxxxxxxxxxxxxxxx";
       FaceBookConnect.API_Secret = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
       if (!IsPostBack)
       {
           string code = Request.QueryString["code"];
           if (!string.IsNullOrEmpty(code))
           {
               FaceBookConnect.PostFile(code, "me/photos", (HttpPostedFile)Session["File"], Session["Message"].ToString());
               Session["File"] = null;
               Session["Message"] = null;
           }
       }
   }

   protected void UploadPhoto(object sender, EventArgs e)
   {
       Session["File"] = FileUpload1.PostedFile;
       Session["Message"] = txtMessage.Text;
       FaceBookConnect.Authorize("user_photos", Request.Url.AbsoluteUri.Split('?')[0]);
   }







i我在




i am getting this error on

FaceBookConnect.PostFile

行。

line.

The remote server returned an error: (400) Bad Request.

推荐答案

(400)错误请求是Web语法错误的等价物。内部异常通常有更多关于失败的信息。



发布到FB的文档可以在这里找到:发布到页面 [ ^ ]



您是否经过验证的 [ ^ ]并满足所有要求 [ ^ ]发布?
(400) Bad Request is the web equivalent of Syntax Error. The inner exception usually has more information on what failed.

Documentation for posting to FB can be found here: Posting to a Page[^]

Have you authenticated[^] and met all the requirements[^] for posting?


这篇关于在Facebook墙上发布状态并上传照片。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆