调试以下代码时,我在以下问题上停留了一段时间:
TwitterService service = new TwitterService("_consumerkey", "_consumersecret");
OAuthRequestToken requestToken = service.GetRequestToken();
Uri uri = service.GetAuthorizationUri(requestToken);
Process.Start(uri.ToString());
Console.Write("Verificatiecode? ");
string verifier = Console.ReadLine();
OAuthAccessToken access = service.GetAccessToken(requestToken, verifier);
service.AuthenticateWith(access.Token, access.TokenSecret);
TwitterUser twitterUser = service.GetUserProfile(new GetUserProfileOptions());
ListFriendsOptions friends_options = new ListFriendsOptions();
friends_options.UserId = twitterUser.Id;
friends_options.Cursor = -1;
var friends = service.ListFriends(friends_options);
do
{
if (friends_options.Cursor != null)
{
foreach (var friend in friends) {Console.WriteLine(friend.ScreenName);}
friends_options.Cursor = friends.NextCursor;
}
} while (friends_options.Cursor != null);
Console.ReadKey(true);
我这里填写验证码后总是出现溢出异常:
OAuthAccessToken access = service.GetAccessToken(requestToken, verifier);
谁能帮助我?
提前致谢