Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想在连接到 twitter 时获取用户个人资料数据。我设法使用 Tweetsharp Lib 连接并获取访问令牌和访问令牌秘密。但是尝试获取用户配置文件会引发错误。所以我想使用 Rest Api 并自己获取信息。我想看一个如何传递访问令牌和/或访问令牌秘密的示例。任何人都可以帮助我吗?
我是 Tweetinvi 的开发人员,它是一个类似于 Tweetsharp 的库,但它得到了维护并且是最新的。
您可以使用以下代码获取用户配置文件:
TwitterCredentials.SetCredentials("Access_Token", "Access_Token_Secret", "Consumer_Key", "Consumer_Secret"); var user = User.GetUserFromScreenName("<username>");
我希望这可以帮助你的代码。
干杯,林维