【发布时间】:2013-03-17 10:22:54
【问题描述】:
这里有没有人尝试过使用 TweetSharp 用图片发推文?
我尝试了以下方法:
Dictionary<string, Stream> imageDict = new Dictionary<string, Stream>();
imageDict.Add(imagePath, imageStream);
// I'm getting an error with the line below.
// It's saying I have some invalid arguments. :(
status = service.SendTweet(new SendTweetWithMediaOptions() { Status = readerMsg.Message, Images = imageDict });
但最后一行给了我一个无效的参数错误,没有任何有用的理由。
我尝试查看他们的GitHub 页面,但示例仅说明了如何发布简单的短信。
【问题讨论】:
-
查看此拉取请求的第一部分。github.com/danielcrenna/tweetsharp/pull/65/files 调用
SendTweetWithMedia而不是SendTweet可能是问题所在。此外,字典中的键似乎不是图像路径(无论如何你给它一个Stream)示例将“测试”传递给它。 --HTH -
成功了!感谢您指出 SendTweet 错误。创建一个答案,我会接受它。 :)
-
已发布.. 见下文。 -谢谢-
标签: c# asp.net asp.net-mvc twitter tweetsharp