2013-12-03 28 views
1

我正在使用TweetSharp API,並且我需要關注C#中的人員List,但是,我遇到了問題。適當的代碼如下:如何使用TweetSharp API關注用戶

var results = service.Search(new SearchOptions {Q = hashtag}); //hashtag string entered by user 
List<decimal> users = new List<decimal>(); 

foreach (var tweet in results.Statuses) 
{ 
    users.Add(tweet.User.Id); 
} 

foreach (decimal user in users) 
{ 
    service.FollowUser(user); //follow each user, the issue is here. 
} 

顯然我使用無效參數。

+0

然後,顯然你需要解決這個問題。如果您希望我們提供幫助,發佈確切的錯誤將會有所幫助。 – nvoigt

+0

這只是說我使用無效參數,更具體地說,「TweetSharp.TwitterService.FollowUser(TweetSharp.FollowUserOptions)'的最佳重載方法匹配有一些無效參數。」我很確定我正確地使用這個,所以我只是想知道你是否有任何想法。對不清楚的道歉。 – user3062724

回答

0

FollowUser方法將FollowUserOptions類型作爲參數,而不是小數。試試這個:

foreach (var user in users) 
{ 
    var options = new FollowUserOptions 
    { 
     UserId = user 
    }; 

    service.FollowUser(options); 
} 
相關問題