트위터에서 트윗을 얻으려고합니다.C# - 인덱스가 범위를 벗어났습니다.
모든 데이터를 데이터베이스에 저장 한 다음 Siebel에 전달합니다. 내가 오류 얻을
:
public void Call_Tweet_Update()
{
var service = new TwitterService(Consumer_Key, Consumer_Secret);
service.AuthenticateWith(Access_Token, AccessToken_Secret);
var tweets = service.ListTweetsOnHomeTimeline(new ListTweetsOnHomeTimelineOptions { Count = 200 });
string[] twt_id = new string[50];
long id = 0;
int i = 0;
int increment = 0;
string twtid;
string screenname;
foreach (var tweet in tweets)
{
if (tweet.InReplyToStatusId.ToString() != "")
{
if ((tweet.User.ScreenName == "IIPL_LTD") || (tweet.Text.StartsWith("@IIPL_LTD")))
{
string replyid = tweet.InReplyToStatusId.ToString();
while (replyid != "")
{
if (i == 0)
{
twt_id[i] = tweet.Id.ToString();
}
id = Convert.ToInt64(replyid);
twtid = tweet.Id.ToString();
i = i + 1;
twt_id[i] = twtid;
replyid = tweet.InReplyToStatusId.ToString();//Here I get an error
increment = increment + 1;
}
}
}
어떤 아이디어 : 아래
Index was out of range
코드인가? 미리 감사드립니다.
귀하를 도와 드릴 수 있도록 더 많은 코드를 제공해야 할 수도 있습니다. –
코드가 불완전합니다. twt_id는 어디에 정의되어 있습니까? – Steve
처음에는'i'의 값은 무엇입니까? 또한 코드를 통해 단계를 밟았거나 코드를 작성하고 이동 했습니까? 'twtid' 어디 정의 된 ..? 어서 오세요 – MethodMan