0

I'm having issues with this piece of code:

OAuthTokens tokens = new OAuthTokens();
tokens.AccessToken = "****";
tokens.AccessTokenSecret = "****";
tokens.ConsumerKey = "****";
tokens.ConsumerSecret = "****";

Small program (as of request):

//cutted out default "using"'s
using Twitterizer;

namespace Mustache_Tweet_App
{
    public partial class Main : Form
    {
        // config
        OAuthTokens Tokens = new OAuthTokens();
        Tokens.AccessToken = "...";
        Tokens.AccessTokenSecret = "...";
        Tokens.ConsumerKey = "...";
        Tokens.ConsumerSecret = "...";
        Tokens.RequestToken = Twitterizer.OAuthUtility.GetRequestToken(Tokens.ConsumerKey, Tokens.ConsumerSecret, "");
        public Main()
        {
            InitializeComponent();
        }

        private void GetAuthKey_Click(object sender, EventArgs e)
        {
            String AuthUri = Twitterizer.OAuthUtility.BuildAuthorizationUri();
            System.Diagnostics.Process(AuthUri);
            MessageBox.Show("Please authorize and copy the key then click OK and paste it into the the key box.", "Info");
        } 
    }
}

Error:

****.Main.tokens' is a 'field' but is used like a 'type'
Invalid token '=' in class, struct, or interface member declaration

Get same error on all "tokens."

Using Twitterizer 2-2-4. also using Visual Studio 2012.

Alexis Pigeon
  • 7,423
  • 11
  • 39
  • 44

1 Answers1

0

The OAuthTokens object does not have a property RequestToken

Also the OAuthTokens.ConsumerKey and OAuthTokens.ConsumerSecret don't have a get accessor, so you can't use them the way you are doing.

Why do you wan't the request tokens? You already have them in the Tokens object.

user1797792
  • 1,169
  • 10
  • 26