这里有人试过使用 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页面,但示例仅说明了如何发布简单的文本消息。
最佳答案
查看此拉取请求的第一部分:TweetSharp Github
调用 SendTweetWithMedia
而不是 SendTweet 可能就是这种情况。
此外,字典中的键似乎不是图像路径(无论如何你给它一个 Stream)示例将“测试”传递给它。
--HTH 玩得开心
关于c# - TweetSharp SendTweetWithMediaOptions 示例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15459686/