2

我正在尝试在 c# 中创建一个与 Tweeter 交互的应用程序...

我做了类似下面的事情..

public void Authorize()
    {
        TwitterService service = new TwitterService("key","secret");
        OAuthRequestToken requestToken = service.GetRequestToken();
        var oauthtoken = requestToken.Token;
        var oauthsecret = requestToken.TokenSecret;
        Uri uri = service.GetAuthorizationUri(requestToken);
        AuthorizeCallback(oauthtoken,oauthverifier);
    }

public void AuthorizeCallback(string oauth_token, string oauth_verifier)
    {
        var requestToken = new OAuthRequestToken { Token = oauth_token };

        TwitterService service = new TwitterService("key","secret");
        OAuthAccessToken accessToken = service.GetAccessToken(requestToken, oauth_verifier);
    }

现在我的问题是从哪里可以获得 oauth_verifier?

4

1 回答 1

1

将这些行放在回调函数的开头。

string OauthToken = Request.QueryString["oauth_token"];

string OauthVerifier = Request.QueryString["oauth_verifier"];
于 2013-12-07T02:16:05.553 回答