與Tweetsharp相反,Tweetinvi正在積極開發中。 有了這個庫,你可以實際發佈的tweet
// Setup the credentials of the account to use
Auth.SetUserCredentials("CONSUMER_KEY", "CONSUMER_SECRET", "ACCESS_TOKEN", "ACCESS_TOKEN_SECRET");
// Upload the image/video that you want to attach to your Tweet (up to 4 images)
byte[] binary = File.ReadAllBytes(filePath);
var media = Upload.UploadImage(binary);
// Publish your tweet
var tweet = Tweet.PublishTweet("This is my awesome photo!", new PublishTweetOptionalParameters
{
Medias = new List<IMedia> { media }
});
// The variable tweet now contains all the information provided by Twitter.
您可以找到有關如何發佈的文檔中鳴叫的更多信息:https://github.com/linvi/tweetinvi/wiki/Tweets。
Tweetinvi github項目提供了一個示例項目(Examplinvi.Web),該項目完全符合您的需求。
你可以在這裏找到:
請讓我知道如果這個回答你的問題。另請注意,我是圖書館的主要開發人員。
我試過這個,但Tweet.PublishTweet不工作。沒有錯誤,異常來了只有點擊按鈕不會返回任何內容。我有一些其他的出路。使用這個鏈接「」http://www.twitter.com/intent/tweet?text=「+ TextBox1.Text」我已經符合我的要求 –