/// <summary> /// Fetch some user info and update this on to the UI /// </summary> /// <param name="accessToken"></param> private void GetUserInfo(OAuthAccessToken accessToken) { try { service.AuthenticateWith(accessToken.Token, accessToken.TokenSecret); GetUserProfileOptions userInfo = new GetUserProfileOptions() { IncludeEntities = true, SkipStatus = false }; var result = service.BeginGetUserProfile(userInfo); var user = service.EndGetUserProfile(result); var imgUrlString = user.ProfileImageUrlHttps; if (imgUrlString.Contains("normal", StringComparison.OrdinalIgnoreCase)) { // To get a bigger image. Refer to https://developer.twitter.com/en/docs/accounts-and-users/user-profile-images-and-banners imgUrlString = imgUrlString.Replace("normal", "bigger", StringComparison.OrdinalIgnoreCase); } twitterUserInfo = new TwitterUserInfo(); twitterUserInfo.Id = user.Id.ToString(); twitterUserInfo.Screen_name = user.ScreenName; twitterUserInfo.profileImage = imgUrlString; this.Close(); } catch (Exception ex) { Console.WriteLine(ex); } }