I have already requested and gained access to 'manage_pages' and 'publish_stream' permissions from a user. How can I use the c# SDK to get permission to post to one of that user's Business Pages wall (They must select one if they Admin multiple Pages, right?). Once I have that access, what is the best method to use the SDK to post to the Business Page wall?
On a related note, can the C# SDK run under ASP.NET 3.5 effectively? Rackspace Cloud Sites is not allowing .NET 4.0 on production servers yet, so I need to see code examples that don't use the 'dynamic' or 'ExpandoObject' keywords.
Thanks!
following is the code if it helps you
FacebookApp fbApp = new FacebookApp();
FacebookApp app = new FacebookApp(fbApp.Session.AccessToken);
var args = new Dictionary<string, object>();
args["message"] = "abc";
args["caption"] = "This is caption!";
args["description"] = "This is description!";
args["name"] = "This is name!";
args["picture"] = "[your image URL]";
args["link"] = "[your link URL]";
app.Api("/me/feed", args, HttpMethod.Post);
You need to replace /me in app.Api's arguments to the specific id of page. I'm not sure if its the right way, but it works for wall post of a user :-)
Here's how with c# SDK 5.1.1
FacebookClient fbClient = new FacebookClient(accessToken);
var args = new Dictionary<string, object>();
args["message"] = "Testing 123";
fbClient.Post("/me/feed", args);
args["picture"] = "[your image URL]";
args["link"] = "[your link URL]";
The image url and link won't work if you give a localhost address.You can try by giving url of an image in a remote server.
来源:https://stackoverflow.com/questions/4361561/how-can-i-use-the-facebook-c-sharp-sdk-to-post-on-facebook-pages