这里有人试过用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页面,但示例只演示了如何发布一条简单的文本消息。
发布于 2013-03-18 03:27:24
查看这个拉取请求的第一部分:TweetSharp Github
调用SendTweetWithMedia而不是SendTweet可能是这种情况。
此外,字典中的关键似乎不是图像路径(无论如何都是给它一个Stream )示例将"test“传递给它。
--HTH玩得开心
发布于 2014-05-29 01:08:18
service.SendTweet()接受SendTweetOptions类型的参数,如果您想发布图像,可以使用
service.SendTweetWithMedia(new SendTweetWithMediaOptions
{
Status = "message",
Images = dictionary
}
);https://stackoverflow.com/questions/15459686
复制相似问题