0

Tweetinvi使用nuget我的库添加库asp.net application并尝试示例后:

我确保添加以下references内容:

using Tweetinvi;
using Tweetinvi.Models;
var applicationCredentials = CredentialsCreator.GenerateApplicationCredentials(ConsumerKey, 
ConsumerSecret);

我收到以下错误:CredentialsCreator当前上下文中不存在名称“”。

4

1 回答 1

1

这取决于您使用的版本,但CredentialsCreator它是不再使用的旧逻辑。

您现在可以执行以下操作:

new ConsumerCredentials("CONSUMER_TOKEN", "CONSUMER_SECRET")
{
    ApplicationOnlyBearerToken = "BEARER_TOKEN"
};

// or if you want to set the credentials
Auth.SetApplicationOnlyCredentials("CONSUMER_KEY", "CONSUMER_SECRET", "BEARER_TOKEN");

// if you do not have the bearer token and want tweetinvi to retrieve it for you
Auth.SetApplicationOnlyCredentials("CONSUMER_KEY", "CONSUMER_SECRET", true);

我希望这可以帮助你

于 2019-02-13T10:48:22.173 回答