我尝试使用应用程序访问令牌发布到用户墙,但它仍然从用户名发布。是否可以从应用程序的名称发布?
var fbc = new FacebookWebClient();
var wc = new WebClient();
var tokenStr = wc.DownloadString(string.Format("https://graph.facebook.com/oauth/access_token?client_id={0}&client_secret={1}&grant_type=client_credentials",
FacebookApplication.Current.AppId, FacebookApplication.Current.AppSecret));
fbc.AccessToken = tokenStr.Replace("access_token=", string.Empty);
dynamic parameters = new ExpandoObject();
parameters.message = "testMessage";
//parameters.link = pageLink;
parameters.name = "testCaption";
dynamic result = fbc.Post(string.Format("{0}/feed", userID), parameters);
答案 0 :(得分:0)
var fbPost = new FacebookClient ( accessToken );
dynamic result = fbPost.Post ( "me/feed", new { message = "Welcome to C# SDK and me" } );