** Ich kann die Installation tun, aber in meinem eigenen Namen als Administrator der Facebook ist nicht teilen teilen. Was könnte das Problem sein? Asp.net Ich verwende Facebook sdkWie kann Facebook Fan Seite Admin Post
, wie Sie Administratorzugriff auf die Fanpage
protected void Page_Load(object sender, EventArgs e)
{
if (Request["Code"] == null)
{
Response.Redirect(string.Format("https://graph.facebook.com/oauth/authorize?client_id={0}&redirect_uri={1}&scope={2}", app_id, Request.Url.AbsoluteUri, scope));
}
}
private void CheckAuthorization()
{
Dictionary<string, string> tokens = new Dictionary<string, string>();
string url = string.Format("https://graph.facebook.com/oauth/access_token?client_id={0}&redirect_uri={1}&scope={2}&code={3}&client_secret={4}", app_id, Request.Url.AbsoluteUri, scope, Request["Code"], app_secret);
HttpWebRequest request = System.Net.WebRequest.Create(url) as HttpWebRequest;
using (HttpWebResponse response = request.GetResponse() as HttpWebResponse)
{
StreamReader reader = new StreamReader(response.GetResponseStream());
string vals = reader.ReadToEnd();
foreach (string token in vals.Split('&'))
{
tokens.Add(token.Substring(0, token.IndexOf("=")), token.Substring(token.IndexOf("=") + 1, token.Length - token.IndexOf("=") - 1));
}
}
string access_token = tokens["access_token"];
dynamic messagePost = new ExpandoObject();
messagePost.access_token = access_token;
messagePost.picture = "picture";
messagePost.link = "link";
messagePost.name = "name";
messagePost.caption = "caption";
messagePost.description = "description ";
FacebookClient app = new FacebookClient(access_token);
app.Post("/PAGE ID/feed", messagePost);
}
Nun, wie kann ich diesen Code in Abschnitt? – hknkadioglu