我刚刚启动了一个 Windows Phone 应用程序,我需要获得所有用户的关注。我试过这个:
SharedState.Authorizer = pinAuth;
ITwitterAuthorizer auth = SharedState.Authorizer;
TwitterContext twitterCtx = new TwitterContext(auth);
var friendList =
(from friend in twitterCtx.SocialGraph
where friend.Type == SocialGraphType.Friends && friend.ScreenName == "_TDK"
select friend)
.SingleOrDefault();
List<String> Followings;
foreach (var id in friendList.ScreenName)
{
Followings.Add(id.ToString());
}
但是friendlist总是为空,显然,foreach
不喜欢这样并抛出一个exception
.
有人可以帮助我吗?
谢谢。