【发布时间】:2014-08-28 07:16:36
【问题描述】:
我成功地将照片发布到 Twitter。但是如何使用我的 C# 应用程序将视频发布到 Twitter?为了发布图片,我使用了 Tweetsharp。我们可以使用 Tweetsharp 的 SendTweetWithMediaOptions 来分享视频吗?如果是怎么办?
这是我用来分享图片到 twitter 的示例
Bitmap img = new Bitmap(Server.MapPath(@"~/Images/Special/" + Convert.ToInt32(offerId) + "/" + specialOffer.Picture));
MemoryStream ms = new MemoryStream();
img.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);
ms.Seek(0, SeekOrigin.Begin);
Dictionary<string, Stream> images = new Dictionary<string, Stream> { { "mypicture", ms } };
var tweet = tweetservice.SendTweetWithMedia(new SendTweetWithMediaOptions { Status = urlTextToShare, Images = images });
我需要的是下图
【问题讨论】:
-
否决这个问题的人请告诉我答案。
-
您的问题含糊且开放。您尝试过什么,以什么方式不起作用。发布示例代码。
-
我不知道该怎么做。这就是我在这里问这个问题的原因。如果您想参考我的图片发布代码,请查看我编辑的问题。
-
现在可以在推特上上传视频了,看看文档dev.twitter.com/rest/public/uploading-media
标签: c# twitter tweetsharp