0
如何使用Facebook標記照片c#sdk。Facebook C#SDK使用標記上傳照片
這是我的代碼(上傳圖片):
var fbApp = new FacebookClient(Session["xAccessToken"].ToString());
string xfilename = MergedCombinedImage.ImageUrl;
xfilename = xfilename.Replace("images/temp/", "");
var fbUpl = new Facebook.FacebookMediaObject
{
FileName = xfilename,
ContentType = "image/jpg"
};
var bytes = System.IO.File.ReadAllBytes(Server.MapPath(MergedCombinedImage.ImageUrl));
fbUpl.SetValue(bytes);
var photoDetails = new Dictionary<string, object>();
photoDetails.Add("message", "test");
photoDetails.Add("image", fbUpl);
var fbResult = fbApp.Post(@"/" + albumID + @"/photos", photoDetails);
var result = (IDictionary<string, object>)fbResult;
var photoID = result["id"];
感謝
pongpang