Post story to facebook wall using c#

Hi,

Do you want to post story on your Facebook wall using c#?

Please follow the steps as following :

[Ignore this step if you have created application in Facebook and done with login  functionality]
Step 1 : Create application into Facebook, Login using javascript and get access token :
http://narendrajarad.blogspot.in/2014/07/facebook-login-using-javascript.html

[Ignore this step if you have already add reference of Facebook from Nuget packages to your project]
Step 2 : Add reference of Facebook to your project :
http://narendrajarad.blogspot.in/2014/07/add-reference-of-facebook-from-nuget-to.html

Finally use this below code to "Post story to Facebook wall using c#".

var accessToken = hdfAccessToken.Value;
dynamic messagePost = new ExpandoObject();
messagePost.picture = "http://3.bp.blogspot.com/-CFEco4MGGtU/U8dsu-UDsHI/AAAAAAAAAVU/rwkjjqCUhe0/s1600/2ebedec.jpg";
messagePost.link = "http://narendrajarad.blogspot.in";
messagePost.name = "Narendra Jarad's Blog";             
messagePost.caption = "Best blog for facebook functionality in c#";
messagePost.description = "Best blog for facebook functionality in c#";
messagePost.message = "Best blog for facebook functionality in c#";

FacebookClient appp = new FacebookClient(accessToken );
try
{
  var postId = appp.Post("me/feed", messagePost);
}
catch (FacebookOAuthException ex)
{
  //handle oauth exception
}
catch (FacebookApiException ex)
{
     //handle facebook exception
}

Comments