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