這裏的任何人都試過使用TweetSharp發送圖片嗎?TweetSharp SendTweetWithMediaOptions示例
我試過如下:
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頁面,但該示例僅說明了如何發佈簡單的文本消息。
請參閱本拉請求的第一部分.. HTTPS:/ /github.com/danielcrenna/tweetsharp/pull/65/files 調用'SendTweetWithMedia'而不是'SendTweet'可能是問題所在。另外,字典中的關鍵字似乎並不是圖像路徑(無論如何,您都會給它一個「Stream」)示例將「測試」傳遞給它。 --HTH – Madushan 2013-03-17 10:30:41
工作正常!感謝您指出SendTweet錯誤。創建一個答案,我會接受它。 :) – Ron 2013-03-17 10:41:36
張貼..見下文。 - 謝謝 - – Madushan 2013-03-18 06:17:20