So I am very new to C#, I started learning it a few days ago and I would like to know how you can tweet with C#. I have searched google a lot, looked at some YouTube videos, but they are all old. I found Twitterizer.net, which has this code:
OAuthTokens tokens = new OAuthTokens();
tokens.AccessToken = "XXX";
tokens.AccessTokenSecret = "XXX";
tokens.ConsumerKey = "XXX";
tokens.ConsumerSecret = "XXX";
TwitterResponse<TwitterStatus> tweetResponse = TwitterStatus.Update(tokens, "Hello, #Twitterizer");
if (tweetResponse.Result == RequestResult.Success)
{
messagebox.Show("Message Tweeted!");
}
else
{
messageBox.Show("cannot tweet");
}
I put this code in a button, 'button1', but it doesn't seem to work it pops up a messagebox saying cannot tweet. I have no idea why this is happening. I put this at the top using twitterizer;. I also got my consumer key, consumersecret, token and tokensecret. So I don't know what is the problem, any help would be greatly appreciated. Thank You!