public void StartWaitAndReply(string tweetKeyword) { List<string> lstTweetImages = new List<string>(); try { if (!IsLoggedIn) { Login(); } int counterDataScraped = 0; if (IsLoggedIn) { if (IsNotSuspended) { TwitterDataScrapper tweetScrapper = new TwitterDataScrapper(); lst_Struct_TweetData = tweetScrapper.GetTweetData_WaitReply(tweetKeyword); Log("[ " + DateTime.Now + " ] => [ Extracted " + lst_Struct_TweetData.Count + " Tweet Ids ]"); if (IsTweetWithImage) { if (!Directory.Exists(ImageFolderPath)) { Log("[ " + DateTime.Now + " ] => [ Image Folder Does't Exist. ]"); return; } ///Load Image ... lstTweetImages = GetImagePathFromFolder(ImageFolderPath); if (lstTweetImages.Count != 0) { if (lstTweetImages.Count < listTweetMessages.Count) { int remaining = listTweetMessages.Count - lstTweetImages.Count; for (int i = 0; i < remaining; i++) { string Imagepath = string.Empty; try { Imagepath = lstTweetImages[i]; } catch (Exception ex) { i = 0; Imagepath = lstTweetImages[i]; } lstTweetImages.Add(Imagepath); } } else { ///if images is greater than messages. } } else { Log("[ " + DateTime.Now + " ] => [ Please Folder is Empty. Please add images in :- " + ImageFolderPath + " ]"); return; } ///print number of Images ... Log("[ " + DateTime.Now + " ] => [ " + lstTweetImages.Count() + " Images uploaded. ]"); foreach (string item in lstTweetImages) { que_ImagePath_WaitAndReply.Enqueue(item); } } while (que_TweetMessages_WaitAndReply.Count > 0) { if (que_ReplyMessages_WaitAndReply.Count <= 0) { break; } if (que_TweetMessages_WaitAndReply.Count <= 0) { break; } #region MyRegion ////Tweet ////listTweetMessages = Randomiser.Shuffle(listTweetMessages).ToList(); //foreach (string item in listTweetMessages) //{ // que_TweetMessages.Enqueue(item); //} ////listTweetMessages = Randomiser.Shuffle(listTweetMessages).ToList(); //foreach (string item in listReplyMessages) //{ // que_ReplyMessages.Enqueue(item); //} #endregion int countTweetsSent = 0; int interval = WaitAndReplyInterval; while (countTweetsSent < noOfTweetsPerReply) { //Tweet string tweetStatus; string tweetMessage = ""; string ImagePath=""; #region MyRegion //if (que_TweetMessages.Count == 0) //{ // //listTweetMessages = Randomiser.Shuffle(listTweetMessages).ToList(); // foreach (string item in listTweetMessages) // { // que_TweetMessages.Enqueue(item); // } //} #endregion lock (locker_que_TweetMessages_WaitAndReply) { if (que_TweetMessages_WaitAndReply.Count > 0) { try { tweetMessage = que_TweetMessages_WaitAndReply.Dequeue(); ImagePath = que_ImagePath_WaitAndReply.Dequeue(); } catch (Exception ex) { GlobusFileHelper.AppendStringToTextfileNewLine(DateTime.Now + " --> Error --> TweetAccountManager -- locker_que_TweetMessages_WaitAndReply -- --> " + ex.Message, Globals.Path_WaitNreplyErroLog); GlobusFileHelper.AppendStringToTextfileNewLine(DateTime.Now + " --> Error --> TweetAccountManager -- StartWaitAndReply() -- locker_que_TweetMessages_WaitAndReply -- " + Username + " --> " + ex.Message, Globals.Path_TweetAccountManager); } } else { Log("[ " + DateTime.Now + " ] => [All Loaded Tweet Messages Used ]"); break; } } if (IsTweetWithImage) { tweeter.TweetMessageWithImage(ref globusHttpHelper, postAuthenticityToken, tweetMessage, ImagePath, out tweetStatus); if (tweetStatus == "posted") { Log("[ " + DateTime.Now + " ] => [ Tweeted : " + tweetMessage + " with image:"+ImagePath+" by " + Username + " ]"); clsDBQueryManager DataBase = new clsDBQueryManager(); string dbTweetMessage = StringEncoderDecoder.Encode(tweetMessage); DataBase.InsertMessageData(Username, "Tweet", "", dbTweetMessage); GlobusFileHelper.AppendStringToTextfileNewLine(Username + ":" + Password + ":" + proxyAddress + ":" + proxyPort + ":" + proxyUsername + ":" + proxyPassword+":"+tweetMessage, Globals.path_SuccessfullyTweetAccounts); countTweetsSent++; if (!waitAndReplyIsIntervalInsec) { Log("[ " + DateTime.Now + " ] => [ Delay For : " + TimeSpan.FromMilliseconds(interval).Minutes + " Minutes ]"); Thread.Sleep(interval); } else { try { interval = RandomNumberGenerator.GenerateRandom(waitAndReplyMinInterval, waitAndReplyMaxInterval); } catch { } Log("[ " + DateTime.Now + " ] => [ Delay For : " + interval + " seconds. ]"); interval = interval * 1000; Thread.Sleep(interval); } } else { Log("[ " + DateTime.Now + " ] => [ Couldn't Post : " + tweetMessage + " with image:"+ImagePath+" by " + Username + " ]"); GlobusFileHelper.AppendStringToTextfileNewLine(Username + ":" + Password + ":" + proxyAddress + ":" + proxyPort + ":" + proxyUsername + ":" + proxyPassword + ":" + tweetMessage, Globals.path_FailedToTweetAccounts); countTweetsSent++; //Log("[ " + DateTime.Now + " ] => [ Delay For : " + TimeSpan.FromMilliseconds(interval).Minutes + " Minutes ]"); //Thread.Sleep(interval); if (!waitAndReplyIsIntervalInsec) { Log("[ " + DateTime.Now + " ] => [ Delay For : " + TimeSpan.FromMilliseconds(interval).Minutes + " Minutes ]"); Thread.Sleep(interval); } else { try { interval = RandomNumberGenerator.GenerateRandom(waitAndReplyMinInterval, waitAndReplyMaxInterval); } catch { } Log("[ " + DateTime.Now + " ] => [ Delay For : " + interval + " seconds. ]"); interval = interval * 1000; Thread.Sleep(interval); } } } else { tweeter.Tweet(ref globusHttpHelper, postAuthenticityToken, tweetMessage, out tweetStatus); if (tweetStatus == "posted") { Log("[ " + DateTime.Now + " ] => [ Tweeted : " + tweetMessage + " by " + Username + " ]"); clsDBQueryManager DataBase = new clsDBQueryManager(); string dbTweetMessage = StringEncoderDecoder.Encode(tweetMessage); DataBase.InsertMessageData(Username, "Tweet", "", dbTweetMessage); GlobusFileHelper.AppendStringToTextfileNewLine(Username + ":" + Password + ":" + proxyAddress + ":" + proxyPort + ":" + proxyUsername + ":" + proxyPassword + ":" + tweetMessage, Globals.path_SuccessfullyTweetAccounts); countTweetsSent++; //Log("[ " + DateTime.Now + " ] => [ Delay For : " + TimeSpan.FromMilliseconds(interval).Minutes + " Minutes ]"); //Thread.Sleep(interval); if (!waitAndReplyIsIntervalInsec) { Log("[ " + DateTime.Now + " ] => [ Delay For : " + TimeSpan.FromMilliseconds(interval).Minutes + " Minutes ]"); Thread.Sleep(interval); } else { try { interval = RandomNumberGenerator.GenerateRandom(waitAndReplyMinInterval, waitAndReplyMaxInterval); } catch { } Log("[ " + DateTime.Now + " ] => [ Delay For : " + interval + " seconds. ]"); interval = interval * 1000; Thread.Sleep(interval); } } else { Log("[ " + DateTime.Now + " ] => [ Couldn't Post : " + tweetMessage + " by " + Username + " ]"); GlobusFileHelper.AppendStringToTextfileNewLine(Username + ":" + Password + ":" + proxyAddress + ":" + proxyPort + ":" + proxyUsername + ":" + proxyPassword + ":" + tweetMessage, Globals.path_FailedToTweetAccounts); countTweetsSent++; //Log("[ " + DateTime.Now + " ] => [ Delay For : " + TimeSpan.FromMilliseconds(interval).Minutes + " Minutes ]"); //Thread.Sleep(interval); if (!waitAndReplyIsIntervalInsec) { Log("[ " + DateTime.Now + " ] => [ Delay For : " + TimeSpan.FromMilliseconds(interval).Minutes + " Minutes ]"); Thread.Sleep(interval); } else { try { interval = RandomNumberGenerator.GenerateRandom(waitAndReplyMinInterval, waitAndReplyMaxInterval); } catch { } Log("[ " + DateTime.Now + " ] => [ Delay For : " + interval + " seconds. ]"); interval = interval * 1000; Thread.Sleep(interval); } } } } //Reply if (lst_Struct_TweetData.Count == 0) { lst_Struct_TweetData = tweetScrapper.GetTweetData_New(tweetKeyword); } if (lst_Struct_TweetData.Count != 0) { int counter_Reply = 1; //foreach (TwitterDataScrapper.StructTweetIDs item in lst_Struct_TweetData) //{ while (countTweetsSent == counter_Reply * noOfTweetsPerReply && que_ReplyMessages_WaitAndReply.Count > 0) { string replyStatus; string replyMessage = ""; #region MyRegion //if (counter_Reply >= 1) //{ // break; //} //if (que_ReplyMessages.Count == 0) //{ // //listReplyMessages = Randomiser.Shuffle(listReplyMessages).ToList(); // foreach (string ReplyMessage in listReplyMessages) // { // que_ReplyMessages.Enqueue(ReplyMessage); // } //} #endregion lock (locker_que_ReplyMessage_WaitAndReply) { if (que_ReplyMessages_WaitAndReply.Count > 0) { try { //replyMessage = listReplyMessages[RandomNumberGenerator.GenerateRandom(0, listReplyMessages.Count - 1)]; replyMessage = que_ReplyMessages_WaitAndReply.Dequeue(); } catch (Exception ex) { GlobusFileHelper.AppendStringToTextfileNewLine(DateTime.Now + " --> Error --> TweetAccountManager -- locker_que_ReplyMessage_WaitAndReply -- --> " + ex.Message, Globals.Path_WaitNreplyErroLog); GlobusFileHelper.AppendStringToTextfileNewLine(DateTime.Now + " --> Error --> TweetAccountManager -- StartWaitAndReply() -- locker_que_ReplyMessage_WaitAndReply -- " + Username + " --> " + ex.Message, Globals.Path_TweetAccountManager); } } else { Log("[ " + DateTime.Now + " ] => [ All Loaded Reply Messages Used ]"); break; } } tweeter.Reply(ref globusHttpHelper, pgSrc_Profile, postAuthenticityToken, lst_Struct_TweetData[counterDataScraped].ID_Tweet, lst_Struct_TweetData[counterDataScraped].username__Tweet_User, replyMessage, out replyStatus); if (replyStatus == "posted") { counter_Reply++; clsDBQueryManager DataBase = new clsDBQueryManager(); string dbTweetMessage = StringEncoderDecoder.Encode(lst_Struct_TweetData[counterDataScraped].wholeTweetMessage); DataBase.InsertMessageData(Username, "Reply", lst_Struct_TweetData[counterDataScraped].ID_Tweet_User, lst_Struct_TweetData[counterDataScraped].wholeTweetMessage); Log("[ " + DateTime.Now + " ] => [ Replied : " + replyMessage + " by " + Username + " ]"); GlobusFileHelper.AppendStringToTextfileNewLine(Username + ":" + Password + ":" + proxyAddress + ":" + proxyPort + ":" + proxyUsername + ":" + proxyPassword + ":" + replyMessage, Globals.path_SuccessfullyRepliedAccounts); } else { counter_Reply++; Log("[ " + DateTime.Now + " ] => [ Couldn't Reply : " + replyMessage + " by " + Username + " ]"); GlobusFileHelper.AppendStringToTextfileNewLine(Username + ":" + Password + ":" + proxyAddress + ":" + proxyPort + ":" + proxyUsername + ":" + proxyPassword + ":" + replyMessage, Globals.path_FailedRepliedAccounts); } //Log("[ " + DateTime.Now + " ] => [ Delay For : " + TimeSpan.FromMilliseconds(interval).Minutes + " Minutes ]"); //Thread.Sleep(interval); if (!waitAndReplyIsIntervalInsec) { Log("[ " + DateTime.Now + " ] => [ Delay For : " + TimeSpan.FromMilliseconds(interval).Minutes + " Minutes ]"); Thread.Sleep(interval); } else { try { interval = RandomNumberGenerator.GenerateRandom(waitAndReplyMinInterval, waitAndReplyMaxInterval); } catch { } Log("[ " + DateTime.Now + " ] => [ Delay For : " + interval + " seconds. ]"); interval = interval * 1000; Thread.Sleep(interval); } counterDataScraped++; if (countTweetsSent <= noOfTweetsPerReply) { countTweetsSent = 0; break; } } } else { Log("[ " + DateTime.Now + " ] => [ Tweet Data is not available for Tweet Keyword:- " + tweetKeyword + " ]"); } } if (que_ReplyMessages_WaitAndReply.Count <= 0) { Log("[ " + DateTime.Now + " ] => [ Remaining Reply Message : " + que_ReplyMessages_WaitAndReply.Count + " ]"); Log("[ " + DateTime.Now + " ] => [ Finished Reply Messages ]"); Log("------------------------------------------------------------------------------------------------------------------------------------------"); } if (que_TweetMessages_WaitAndReply.Count <= 0) { Log("[ " + DateTime.Now + " ] => [ Remaining Tweet Message: " + que_TweetMessages_WaitAndReply.Count + " ]"); Log("[ " + DateTime.Now + " ] => [ Finished Tweet Messages ]"); Log("------------------------------------------------------------------------------------------------------------------------------------------"); } //Log("Finished Replying with : " + Username); } } else { Log("[ " + DateTime.Now + " ] => [ Couldn't log in with :" + Username + " ]"); GlobusFileHelper.AppendStringToTextfileNewLine(Username + ":" + Password + ":" + proxyAddress + ":" + proxyPort + ":" + proxyUsername + ":" + proxyPassword, Globals.path_FailedLoginAccounts); } } catch (Exception ex) { //Log("[ " + DateTime.Now + " ] => [ >>Error :- TweetAccountManager (StartWaitAndReply)>> " + ex.Message + " ]"); Globussoft.GlobusFileHelper.AppendStringToTextfileNewLine(DateTime.Now + " --> Error --> TweetAccountManager -- StartWaitAndReply --> " + ex.Message, Globals.Path_WaitNreplyErroLog); GlobusFileHelper.AppendStringToTextfileNewLine(DateTime.Now + " --> Error --> TweetAccountManager -- StartWaitAndReply() -- " + Username + " --> " + ex.Message, Globals.Path_TweetAccountManager); } }
public void btn_FollowByKeyWordStart_Click(object sender, EventArgs e) { CheckNetConn = System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable(); if (CheckNetConn) { if (!string.IsNullOrEmpty(txt_FollowBySearchKey.Text)) { objclsSettingDB.InsertOrUpdateSetting("Follower", "FollowBySearchKey", StringEncoderDecoder.Encode(txt_FollowBySearchKey.Text)); } if (IsFollowByKeyWordStart) { IsFollowByKeyWordStart = false; // new Thread(() => // { Dic_Thread.Clear(); Thread.CurrentThread.Name = "Thread_FollowByKeyword"; Dic_Thread.Add(Thread.CurrentThread.Name, Thread.CurrentThread); //TweetAccountManager TweetAccountManager = new TweetAccountManager(); //TwitterDataScrapper TwitterDataScrapper = new TwitterDataScrapper(); //int FollowLimitCounter = 0; //int AccountCounter = 0; FollowtweetKeywordList.ForEach(i => { searchkeywordqueue.Enqueue(i); }); int NoOfThreads = int.Parse(txtNoOfFollowThreads.Text); int DelayStart = 0; int DelayEnd = 0; bool _IsValue = false; _IsValue = int.TryParse((txtFollowMinDelay.Text), out DelayStart); if (!_IsValue) { IsFollowByKeyWordStart = true; return; } _IsValue = false; _IsValue = int.TryParse((txtFollowMaxDelay.Text), out DelayEnd); if (!_IsValue) { IsFollowByKeyWordStart = true; return; } string SeachKey = string.Empty; List<TwitterDataScrapper.StructTweetIDs> KeywordStructData = new List<TwitterDataScrapper.StructTweetIDs>(); TwitterDataScrapper TwitterDataScrapper = new TwitterDataScrapper(); if (FollowtweetKeywordList.Count != 0) { //TwitterDataScrapper.noOfRecords = int.Parse(txt_FollowByPerAccount.Text); txt_FollowByPerAccount.Invoke(new MethodInvoker(delegate { if (!string.IsNullOrEmpty(txt_FollowByPerAccount.Text)) { TwitterDataScrapper.noOfRecords = int.Parse(txt_FollowByPerAccount.Text); } else { TwitterDataScrapper.noOfRecords = 5; } })); if (!chk_followbysinglekeywordperaccount.Checked) { try { if (searchkeywordqueue.Count == 0) { return; } SeachKey = searchkeywordqueue.Dequeue().ToString();//FollowtweetKeywordList[counterThreadsFollowByKeyWord]; AddToLog_Follower("[ " + DateTime.Now + " ] => [ Start Scraping User for keyword= " + SeachKey + " ]"); KeywordStructData = TwitterDataScrapper.GetTweetData_New(SeachKey); if (KeywordStructData.Count == 0) { KeywordStructData = TwitterDataScrapper.NewKeywordStructData(SeachKey); } } catch (Exception) { } } else { //TwitterDataScrapper.logEvents.addToLogger += new EventHandler(logEvents_Follower_addToLogger); foreach (string SeachKey_item in FollowtweetKeywordList) { AddToLog_Follower("[ " + DateTime.Now + " ] => [ Start Scraping User for keyword= " + SeachKey_item + " . ]"); List<TwitterDataScrapper.StructTweetIDs> KeywordStructData1 = new List<TwitterDataScrapper.StructTweetIDs>(); int datacounter = 0; KeywordStructData1 = TwitterDataScrapper.NewKeywordStructData1(SeachKey_item); if (KeywordStructData1.Count == 0) { KeywordStructData1 = TwitterDataScrapper.KeywordStructData(SeachKey_item); } if (KeywordStructData1.Count == 0) { AddToLog_Follower("[ " + DateTime.Now + " ] => [ Key Word is not Exist/suspended. ]"); } foreach (var KeywordStructData1_item in KeywordStructData1) { if (datacounter == TwitterDataScrapper.noOfRecords) { break; } else { KeywordStructData.Add(KeywordStructData1_item); datacounter++; } } } } } else { MessageBox.Show("Please Upload Keywords"); //break; } List<List<TwitterDataScrapper.StructTweetIDs>> list_lstTargetUsers = new List<List<TwitterDataScrapper.StructTweetIDs>>(); int index = 0; if (chkUseDivide.Checked || IsUsingDivideData) { int splitNo = 0; if (rdBtnDivideEqually.Checked) { splitNo = KeywordStructData.Count / TweetAccountContainer.dictionary_TweetAccount.Count; } else if (rdBtnDivideByGivenNo.Checked) { if (!string.IsNullOrEmpty(txtScrapeNoOfUsers.Text) && NumberHelper.ValidateNumber(txtScrapeNoOfUsers.Text)) { int res = Convert.ToInt32(txtScrapeNoOfUsers.Text); splitNo = res;//listUserIDs.Count / res; } } if (splitNo == 0) { splitNo = RandomNumberGenerator.GenerateRandom(0, KeywordStructData.Count - 1); } list_lstTargetUsers = Split(KeywordStructData, splitNo); } if (TweetAccountContainer.dictionary_TweetAccount.Count > 0) { NoOfLoadAccount = TweetAccountContainer.dictionary_TweetAccount.Count; try { double Num; bool isNum = double.TryParse((txt_FollowByPerAccount.Text.Trim()), out Num); if (isNum) { AddToLog_Follower("[ " + DateTime.Now + " ] => [ Start process from follow by search keyword. ]"); ThreadPool.SetMaxThreads(NoOfThreads, 5); foreach (KeyValuePair<string, TweetAccountManager> item in TweetAccountContainer.dictionary_TweetAccount) { #region << Old Code >> //string profileUsername = string.Empty; //string profileUserpass = string.Empty; //profileUsername = item.Key; //profileUserpass = item.Value.Password; ////******search profile By keyWords //string SeachKey = string.Empty; //List<TwitterDataScrapper.StructTweetIDs> KeywordStructData = new List<TwitterDataScrapper.StructTweetIDs>(); //if (FollowtweetKeywordList.Count != 0) //{ // if (!chk_followbysinglekeywordperaccount.Checked) // { // try // { // SeachKey = FollowtweetKeywordList[AccountCounter]; // KeywordStructData = TwitterDataScrapper.GetTweetData_New(SeachKey); // if (KeywordStructData.Count == 0) // { // KeywordStructData = TwitterDataScrapper.NewKeywordStructData(SeachKey); // } // } // catch (Exception) // { // } // } // else // { // foreach (string SeachKey_item in FollowtweetKeywordList) // { // List<TwitterDataScrapper.StructTweetIDs> KeywordStructData1 = new List<TwitterDataScrapper.StructTweetIDs>(); // int datacounter = 0; // KeywordStructData1 = TwitterDataScrapper.NewKeywordStructData(SeachKey_item); // if (KeywordStructData1.Count == 0) // { // KeywordStructData1 = TwitterDataScrapper.KeywordStructData(SeachKey_item); // } // if (KeywordStructData1.Count == 0) // { // AddToLog_Follower("Key Word is not Exist/suspended."); // } // foreach (var KeywordStructData1_item in KeywordStructData1) // { // if (datacounter == int.Parse(txt_FollowByPerAccount.Text)) // { // break; // } // else // { // KeywordStructData.Add(KeywordStructData1_item); // datacounter++; // } // } // } // } //} //else //{ // MessageBox.Show("Please Upload Keywords"); // break; //} ////************* //try //{ // if (KeywordStructData.Count > 0) // { // TweetAccountManager AccountManager = (TweetAccountManager)item.Value; // AccountManager.logEvents.addToLogger += new EventHandler(logEvents_Follower_addToLogger); // int DelayStart = 0; // int DelayEnd = 0; // bool _IsValue = false; // _IsValue = int.TryParse((txtFollowMinDelay.Text), out DelayStart); // if (!_IsValue) // { // return; // } // _IsValue = false; // _IsValue = int.TryParse((txtFollowMaxDelay.Text), out DelayEnd); // if (!_IsValue) // { // return; // } // if (!AccountManager.IsLoggedIn) // { // AccountManager.Login(); // } // foreach (var item1 in KeywordStructData) // { // if (!chk_followbysinglekeywordperaccount.Checked) // { // //accordint to get Follow users limits // if (FollowLimitCounter >= (int.Parse(txt_FollowByPerAccount.Text))) // { // FollowLimitCounter = 0; // break; // } // else // { // FollowLimitCounter++; // } // } // //Get follow from user // string AccountId = item1.ID_Tweet_User; // ///Return if Suspended // if (AccountManager.AccountStatus == "Account Suspended") // { // AddToLog_Follower(profileUsername + " : Suspended"); // break; // } // else if ((AccountManager.globusHttpHelper.gResponse.ResponseUri.ToString().ToLower()).Contains("captcha")) // { // AddToLog_Follower(profileUsername + " : Asking for captcha."); // break; // } // getFollowUserBySearch(new object[] { AccountManager, AccountId }); // int Delay = RandomNumberGenerator.GenerateRandom(DelayStart, DelayEnd); // AddToLog_Follower("Delay :- " + Delay + " Seconds."); // Thread.Sleep(Delay); // } // } // else // { // //Message List is Empty // AddToLog_Follower("Key Word File is Empty or Wrong Formate"); // break; // } //} //catch (Exception) //{ //} //if (AccountCounter > TweetAccountContainer.dictionary_TweetAccount.Count) //{ // AccountCounter = 0; //} //else //{ // AccountCounter++; //} #endregion if (counterThreadsFollowByKeyWord >= NoOfThreads) { lock (lockerThreadsFollowByKeyWord) { Monitor.Wait(lockerThreadsFollowByKeyWord); } } if (chkUseDivide.Checked || IsUsingDivideData) { KeywordStructData = list_lstTargetUsers[index]; } //ThreadPool.QueueUserWorkItem(new WaitCallback(StartFollowByKeyWord), new object[] { item, DelayStart, DelayEnd }); Thread threadGetStartProcessForfollow = new Thread(StartFollowByKeyWord); threadGetStartProcessForfollow.Name = "Thread_FollowByKeyword" + "_" + item.Key; threadGetStartProcessForfollow.IsBackground = true; threadGetStartProcessForfollow.Start(new object[] { item, DelayStart, DelayEnd, KeywordStructData }); index++; Thread.Sleep(1000); } }//isNum If End else { MessageBox.Show("Please enter No of follow By per account"); AddToLog_Follower("[ " + DateTime.Now + " ] => [ Please enter No of follow By per account ]"); } } catch (Exception) { } finally { //if (FollowtweetKeywordList.Count == 0) //{ // AddToLog_Follower("Please Upload Keywords"); //} //else //{ // AddToLog_Follower("Follow By key Word Process is Finished."); //} } } else { MessageBox.Show("Please Upload Twitter Account"); AddToLog_Follower("[ " + DateTime.Now + " ] => [ Please Upload Twitter Account ]"); } IsFollowByKeyWordStart = true; // }).Start(); } } else { MessageBox.Show("Your Internet Connection is disabled ! or not working, Please Check Your Internet Connection..."); AddToLog_Follower("[ " + DateTime.Now + " ] => [ Your Internet Connection is disabled ! or not working, Please Check Your Internet Connection... ]"); } }