我写了下面的功能,将单张照片发布到FB页面.但是收到错误说"(OAuthException - #200)(#200)未发布的帖子必须作为页面本身发布到页面上."
private void postToFBPage()
{
string app_id = ConfigurationManager.AppSettings["FBAppKey"];
string app_secret = ConfigurationManager.AppSettings["FBSecretKey"];
string scope = ConfigurationManager.AppSettings["FBPermission"];
string access_token;
if (Session["access_token"] == null)
access_token = getAccessToken();
else
access_token = Session["access_token"].ToString();
var client = new FacebookClient(access_token);
List<string> imgs = (List<string>)Session["local_processedImgs"];
DateTime dt=new DateTime(Convert.ToInt32(ddlYear.SelectedValue)
,Convert.ToInt32(ddlMonth.SelectedValue)
,Convert.ToInt32(ddlDate.SelectedValue)
,Convert.ToInt32(ddlHour.SelectedValue)
,Convert.ToInt32(ddlMin.SelectedValue)
,0);
double UTC = Facebook.DateTimeConvertor.ToUnixTime(dt);
dynamic post = null;
dynamic parameters = new ExpandoObject();
parameters.source = new FacebookMediaObject
{
ContentType = "image/" + Path.GetExtension(imgs[0]),
FileName = imgs[0]
}.SetValue(File.ReadAllBytes(imgs[0]));
parameters.message = CKEditor1.Text;
parameters.scheduled_publish_time …Run Code Online (Sandbox Code Playgroud)