使用Tweetinvi
将nuget
库添加到我的asp.net application
并尝试一个示例之后:
我确保添加references
,例如:
using Tweetinvi;
using Tweetinvi.Models;
var applicationCredentials = CredentialsCreator.GenerateApplicationCredentials(ConsumerKey,
ConsumerSecret);
我收到以下错误:名称'CredentialsCreator
'在当前上下文中不存在。
答案 0 :(得分: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);
希望对您有帮助