我正在尝试使用带有 WP7 的 Facebook C# SDK 将照片上传到 facebook。这是我的代码:
public void PostMessageWithImage(string statusMessage, Stream stream)
{
FacebookClient fb = new FacebookClient(AccessToken);
FacebookMediaStream mediaStream = new FacebookMediaStream
{
FileName = DateTime.Now.ToLocalTime().ToLongDateString(),
ContentType = "image/jpeg",
}.SetValue(stream);
fb.PostCompleted += MessagePostCompleted;
fb.PostAsync(this.id + "/photos", new
{
message = statusMessage, //already tried name and caption
source = mediaStream
});
}
我不断得到这个:
(OAuthException - #1) (#1) An unknown error occurred
at Facebook.FacebookClient.ProcessResponse(HttpHelper httpHelper, String responseString, Type resultType, Boolean containsEtag, IList`1 batchEtags)
at Facebook.FacebookClient.<>c__DisplayClass4.<ApiAsync>b__1(Object o, OpenReadCompletedEventArgs e)
四个月前这段代码运行良好,但现在我无法将照片上传到 Facebook。它仅在我使用 url 而不是文件时才有效。你可以帮帮我吗?