ldg2002
Registered Member
- Jun 5, 2012
- 66
- 6
Hi! this is my little snipped of code, i'm trying to post on Facebook Fan Page with C# as admin. Everythings works but when I look at the post on the page, was released from my profile and not from the page. my profile is the admin of the page. I create the access token herehttps://developers.facebook.com/tools/explorer/ with "manage_pages, offline_access, publish_stream" properties.
Thank you for the help
Thank you for the help
Code:
public bool PostImage(string pageAccessToken, string Status, string Imagepath)
{ try
{ var mediaObject = new FacebookMediaObject
{ ContentType = "image/jpeg", FileName = Path.GetFileName(Imagepath) }.SetValue(File.ReadAllBytes(Imagepath));
var fb = new FacebookClient(pageAccessToken);
fb.Post("/xxxxxxxxxxxxxx/photos", new Dictionary<string, object>
{ { "message", Status }, { "source", mediaObject } } ); return true; }
catch (Exception) { return false; }