Facebook Post Images from wpf c# application

Last Reply 9 days ago By dharmendr

Posted 14 days ago

Hi Mudassar Khan Sir,

I need to connect with facebook and share image after login,

I have done to connect with facebook using their api, but when i am going to post image it shows 200 error.

 

my code is given below : 

here fbtoken is facebook object.

 

{

string photoAlbumID = "199967900755629";

FacebookMediaObject facebookUploader = new FacebookMediaObject { FileName = "Carnival-Mask-Costume-Ideas-800x600.jpg", ContentType = "image/png" };

//var bytes = File.ReadAllBytes(System.IO.Path.GetDirectoryName(System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName) + "\\" + facebookUploader.FileName);
var bytes = File.ReadAllBytes(@"D:\Gallery\Carnival-Mask-Costume-Ideas-800x600.jpg");
facebookUploader.SetValue(bytes);

var postInfo = new Dictionary<string, object>();
postInfo.Add("message", "test photo");
postInfo.Add("image", facebookUploader);
postInfo.Add("access_token", fbtoken.AccessToken);
var fbResult = fbtoken.Post("/" + photoAlbumID + "/photos", postInfo);
dynamic result = (IDictionary<string, object>)fbResult;

}

 

You are viewing reply posted by: g7prakash 12 days ago.
Posted 12 days ago

Hi Dharmendra Sir,

Thankx, for this, But i am working on WCF Windows Application, Today i found why i am getting OAUTH Error #200, I need to add platform in facebook app,

When i am going to add, Window Store SID required after that i search about Window Store SID, It is Paid from Microsoft but i dont know i am on the right track or not

Because Once i purchased, if it wont work it will very expensive for me, if it is available for testing or developer to use then please share it or help me out.

One More Thing i found "WINSDKFb" in nuget package Manager but unable to install the package to check it works with my application or not.

 

Thankx Dharmendra Sir and ASP Forums Teams.