本文整理汇总了C#中BaseLib.clsDBQueryManager.SelectMessageData方法的典型用法代码示例。如果您正苦于以下问题:C# clsDBQueryManager.SelectMessageData方法的具体用法?C# clsDBQueryManager.SelectMessageData怎么用?C# clsDBQueryManager.SelectMessageData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseLib.clsDBQueryManager
的用法示例。
在下文中一共展示了clsDBQueryManager.SelectMessageData方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ThreadPoolMethod_Reply
private void ThreadPoolMethod_Reply(object parameters)
{
try
{
Array paramsArray = new object[2];
paramsArray = (Array)parameters;
KeyValuePair<string, TweetAccountManager> keyValue = (KeyValuePair<string, TweetAccountManager>)paramsArray.GetValue(0);
string tweetMessage = (string)paramsArray.GetValue(1);
TweetAccountManager tweetAccountManager = keyValue.Value;
//Add to Threads Dictionary
AddThreadToDictionary(strModule(Module.Reply), tweetAccountManager.Username);
//string accountUser = tweetAccountManager.Username;
//string accountPass = tweetAccountManager.Password;
//string proxyAddress = tweetAccountManager.proxyAddress;
//string proxyPort = tweetAccountManager.proxyPort;
//string proxyUserName = tweetAccountManager.proxyUsername;
//string proxyPassword = tweetAccountManager.proxyPassword;
//tweetAccountManager = new TweetAccountManager();
//tweetAccountManager.Username = accountUser;
//tweetAccountManager.Password = accountPass;
//tweetAccountManager.proxyAddress = proxyAddress;
//tweetAccountManager.proxyPort = proxyPort;
//tweetAccountManager.proxyUsername = proxyUserName;
//tweetAccountManager.proxyPassword = proxyPassword;
tweetAccountManager.logEvents.addToLogger += new EventHandler(logEvents_Tweet_addToLogger);
//tweetAccountManager.logEvents.addToLogger += logEvents_Tweet_addToLogger;
tweetAccountManager.tweeter.logEvents.addToLogger += logEvents_Tweet_addToLogger;
if (GlobusRegex.ValidateNumber(txtMinDelay_Tweet.Text))
{
replyMinDealy = Convert.ToInt32(txtMinDelay_Tweet.Text);
}
if (GlobusRegex.ValidateNumber(txtMaxDelay_Tweet.Text))
{
replyMaxDealy = Convert.ToInt32(txtMaxDelay_Tweet.Text);
}
if (chkboxReplyPerDay.Checked)
{
TweetAccountManager.ReplyPerDay = true;
if (!string.IsNullOrEmpty(txtMaximumNoRetweet.Text) && NumberHelper.ValidateNumber(txtMaximumNoRetweet.Text))
{
TweetAccountManager.NoOFReplyPerDay = Convert.ToInt32(txtMaximumNoRetweet.Text);
}
else
{
TweetAccountManager.NoOFReplyPerDay = 10;
AddToTweetCreatorLogs("Adding Default Maximum No Of Retweet 10");
}
clsDBQueryManager DbQueryManager = new clsDBQueryManager();
DataSet Ds = DbQueryManager.SelectMessageData(keyValue.Key, "Reply");
int TodayReply = Ds.Tables["tb_MessageRecord"].Rows.Count;
tweetAccountManager.AlreadyReply = TodayReply;
if (TodayReply >= TweetAccountManager.NoOFReplyPerDay)
{
AddToLog_Tweet("Already Retweeted " + TodayReply);
return;
}
}
tweetAccountManager.Reply(tweetMessage, replyMinDealy, replyMaxDealy);
tweetAccountManager.logEvents.addToLogger -= logEvents_Tweet_addToLogger;
tweetAccountManager.tweeter.logEvents.addToLogger -= logEvents_Tweet_addToLogger;
}
catch (Exception ex)
{
ErrorLogger.AddToErrorLogText(ex.Message);
GlobusFileHelper.AppendStringToTextfileNewLine(DateTime.Now + " --> Error --> ThreadPoolMethod_Reply() --> " + ex.Message, Globals.Path_TweetingErroLog);
GlobusFileHelper.AppendStringToTextfileNewLine("Error --> ThreadPoolMethod_Reply() --> " + ex.Message, Globals.Path_TwtErrorLogs);
}
}
示例2: StartDirectMessagingMultithreaded
public void StartDirectMessagingMultithreaded(object parameter)
{
try
{
int MinimumDelay = 15;
int MaximumDelay = 25;
Array paramsArray = new object[1];
paramsArray = (Array)parameter;
KeyValuePair<string, TweetAccountManager> item = (KeyValuePair<string, TweetAccountManager>)paramsArray.GetValue(0);
TweetAccountManager AccountManager = item.Value;
AccountManager.Username = item.Value.Username;
AccountManager.Password = item.Value.Password;
AccountManager.proxyAddress = item.Value.proxyAddress;
AccountManager.proxyPort = item.Value.proxyPort;
AccountManager.proxyUsername = item.Value.proxyUsername;
AccountManager.proxyPassword = item.Value.proxyPassword;
if (!AccountManager.IsLoggedIn)
{
AccountManager.Login();
}
List<string> SelectedItem = new List<string>();
if (chklstDirectMessage.InvokeRequired)
{
chklstDirectMessage.Invoke(new MethodInvoker(delegate
{
foreach (string Userid in chklstDirectMessage.CheckedItems)
{
SelectedItem.Add(Userid);
}
}));
}
int MaximumMsgPerDay = 10;
if (!string.IsNullOrEmpty(txtMessagePerDay.Text) && NumberHelper.ValidateNumber(txtMessagePerDay.Text))
{
MaximumMsgPerDay = Convert.ToInt32(txtMessagePerDay.Text);
}
clsDBQueryManager DbQueryManager = new clsDBQueryManager();
DataSet Ds = DbQueryManager.SelectMessageData(item.Value.Username, "Message");
int TodayMessage = Ds.Tables["tb_MessageRecord"].Rows.Count;
AddToLog_Tweet(TodayMessage + " Already Messaged today");
#region Delay
if (!string.IsNullOrEmpty(txtMinDMDelay.Text) && NumberHelper.ValidateNumber(txtMinDMDelay.Text))
{
MinimumDelay = Convert.ToInt32(txtMinDMDelay.Text);
}
else
{
AddToDMLog("Minimum Delay Value Incorrect");
AddToDMLog("Assinging Defauly Value = 15");
}
if (!string.IsNullOrEmpty(txtMaxDMDelay.Text) && NumberHelper.ValidateNumber(txtMaxDMDelay.Text))
{
MaximumDelay = Convert.ToInt32(txtMaxDMDelay.Text);
}
else
{
AddToDMLog("Minimum Delay Value Incorrect");
AddToDMLog("Assinging Defauly Value = 25");
}
#endregion
foreach (string Userid in SelectedItem)
{
if (TodayMessage >= MaximumMsgPerDay)
{
AddToDMLog("Already Messaged " + TodayMessage);
break;
}
AddToDMLog("Direct Message To " + Userid);
int Delay = RandomNumberGenerator.GenerateRandom(MinimumDelay, MaximumDelay);
string MessagePosted = AccountManager.DirectMessage(Userid);
if (MessagePosted.Contains("Success"))
{
string[] Array = Regex.Split(MessagePosted, ":");
AddToDMLog("Message Posted :"+ Array[1]);
}
else if (MessagePosted.Contains("Error"))
{
AddToDMLog("Error in Post");
}
else
{
AddToDMLog("Message Not Posted");
}
AddToDMLog("Delay For : " + Delay);
Thread.Sleep(Delay);
//.........这里部分代码省略.........
示例3: StartTweetingMultithreaded
private void StartTweetingMultithreaded(object parameters)
{
try
{
Array paramsArray = new object[2];
paramsArray = (Array)parameters;
KeyValuePair<string, TweetAccountManager> keyValue = (KeyValuePair<string, TweetAccountManager>)paramsArray.GetValue(0);
//string userIDToFollow = (string)paramsArray.GetValue(1);
//string tweetMessage = (string)paramsArray.GetValue(1);
List<string> lst_tweetMessage = (List<string>)paramsArray.GetValue(1);
TweetAccountManager tweetAccountManager = keyValue.Value;
//Add to Threads Dictionary
AddThreadToDictionary(strModule(Module.Tweet), tweetAccountManager.Username);
//string accountUser = tweetAccountManager.Username;
//string accountPass = tweetAccountManager.Password;
//string proxyAddress = tweetAccountManager.proxyAddress;
//string proxyPort = tweetAccountManager.proxyPort;
//string proxyUserName = tweetAccountManager.proxyUsername;
//string proxyPassword = tweetAccountManager.proxyPassword;
//tweetAccountManager = new TweetAccountManager();
//tweetAccountManager.Username = accountUser;
//tweetAccountManager.Password = accountPass;
//tweetAccountManager.proxyAddress = proxyAddress;
//tweetAccountManager.proxyPort = proxyPort;
//tweetAccountManager.proxyUsername = proxyUserName;
//tweetAccountManager.proxyPassword = proxyPassword;
tweetAccountManager.tweeter.logEvents.addToLogger += new EventHandler(logEvents_Tweet_addToLogger);
tweetAccountManager.logEvents.addToLogger += logEvents_Tweet_addToLogger;
if (GlobusRegex.ValidateNumber(txtMinDelay_Tweet.Text))
{
tweetMinDealy = Convert.ToInt32(txtMinDelay_Tweet.Text);
}
if (GlobusRegex.ValidateNumber(txtMaxDelay_Tweet.Text))
{
tweetMaxDealy = Convert.ToInt32(txtMaxDelay_Tweet.Text);
}
//tweetAccountManager.Login();
//tweetAccountManager.Tweet(tweetMessage);
if (ChkboxTweetPerday.Checked)
{
TweetAccountManager.NoOfTweets = 0;
TweetAccountManager.TweetPerDay = true;
if (!string.IsNullOrEmpty(txtMaximumTweet.Text) && NumberHelper.ValidateNumber(txtMaximumTweet.Text))
{
TweetAccountManager.NoOfTweetPerDay = Convert.ToInt32(txtMaximumTweet.Text);
AddToLog_Tweet(TweetAccountManager.NoOfTweetPerDay + " Maximum No Of Tweets Per Day");
}
else
{
TweetAccountManager.NoOfTweetPerDay = 10;
AddToLog_Tweet("Setting Maximum No Of Tweets Per Day as 10");
}
clsDBQueryManager DbQueryManager = new clsDBQueryManager();
DataSet Ds = DbQueryManager.SelectMessageData(keyValue.Key, "Tweet");
int TodayTweet = Ds.Tables["tb_MessageRecord"].Rows.Count;
tweetAccountManager.AlreadyTweeted = TodayTweet;
AddToLog_Tweet(TodayTweet + " Already tweeted today");
if (TodayTweet >= TweetAccountManager.NoOfTweetPerDay)
{
AddToLog_Tweet("Already Tweeted " + TweetAccountManager.NoOfTweetPerDay);
return;
}
}
if (IsTweetScheduled)
{
try
{
DateTime d1 = dateTimePicker_tweeterStart.Value.ToLocalTime();
DateTime d2 = dateTimePicker_TwetterEnd.Value.ToLocalTime();
TweetAccountManager.StartTime = d1;
TweetAccountManager.EndTime = d2;
TimeSpan T = d2 - d1;
int Delay = T.Minutes;
int TotalTweets = 0;
if (!string.IsNullOrEmpty(txtNoOfTweets.Text) && NumberHelper.ValidateNumber(txtNoOfTweets.Text))
{
TotalTweets = Convert.ToInt32(txtNoOfTweets.Text);
}
//.........这里部分代码省略.........
示例4: ThreadpoolMethod_Retweet
private void ThreadpoolMethod_Retweet(object parameters)
{
try
{
Thread.CurrentThread.IsBackground = true;
Array paramsArray = new object[1];
paramsArray = (Array)parameters;
KeyValuePair<string, TweetAccountManager> keyValue = (KeyValuePair<string, TweetAccountManager>)paramsArray.GetValue(0);
TweetAccountManager tweetAccountManager = keyValue.Value;
if(chkBoxUseGroup.Checked && !string.IsNullOrEmpty(txtTweetUseGroup.Text))
{
if(tweetAccountManager.GroupName != txtTweetUseGroup.Text)
{
return;
}
}
else
{
AddToLog_Tweet("Please Enter A Tweet Keyword");
}
//Add to Threads Dictionary
AddThreadToDictionary(strModule(Module.Retweet), tweetAccountManager.Username);
//string accountUser = tweetAccountManager.Username;
//string accountPass = tweetAccountManager.Password;
//string proxyAddress = tweetAccountManager.proxyAddress;
//string proxyPort = tweetAccountManager.proxyPort;
//string proxyUserName = tweetAccountManager.proxyUsername;
//string proxyPassword = tweetAccountManager.proxyPassword;
//tweetAccountManager = new TweetAccountManager();
//tweetAccountManager.Username = accountUser;
//tweetAccountManager.Password = accountPass;
//tweetAccountManager.proxyAddress = proxyAddress;
//tweetAccountManager.proxyPort = proxyPort;
//tweetAccountManager.proxyUsername = proxyUserName;
//tweetAccountManager.proxyPassword = proxyPassword;
tweetAccountManager.logEvents.addToLogger -= logEvents_Tweet_addToLogger;
tweetAccountManager.tweeter.logEvents.addToLogger -= logEvents_Tweet_addToLogger;
tweetAccountManager.logEvents.addToLogger += new EventHandler(logEvents_Tweet_addToLogger);
//tweetAccountManager.logEvents.addToLogger += logEvents_Tweet_addToLogger;
tweetAccountManager.tweeter.logEvents.addToLogger += logEvents_Tweet_addToLogger;
if (GlobusRegex.ValidateNumber(txtMinDelay_Tweet.Text))
{
retweetMinDealy = Convert.ToInt32(txtMinDelay_Tweet.Text);
}
if (GlobusRegex.ValidateNumber(txtMaxDelay_Tweet.Text))
{
retweetMaxDealy = Convert.ToInt32(txtMaxDelay_Tweet.Text);
}
if (chkboxRetweetPerDay.Checked)
{
TweetAccountManager.RetweetPerDay = true;
if (!string.IsNullOrEmpty(txtMaximumNoRetweet.Text) && NumberHelper.ValidateNumber(txtMaximumNoRetweet.Text))
{
TweetAccountManager.NoOFRetweetPerDay = Convert.ToInt32(txtMaximumNoRetweet.Text);
AddToLog_Tweet("Maximum No Of ReTweet Per day " + TweetAccountManager.NoOFRetweetPerDay);
}
else
{
TweetAccountManager.NoOFRetweetPerDay = 10;
AddToLog_Tweet("Setting Maximum No Of ReTweets Per Day as 10");
}
clsDBQueryManager DbQueryManager = new clsDBQueryManager();
DataSet Ds = DbQueryManager.SelectMessageData(keyValue.Key, "ReTweet");
int TodayReTweet = Ds.Tables["tb_MessageRecord"].Rows.Count;
tweetAccountManager.AlreadyRetweeted = TodayReTweet;
if (TodayReTweet >= TweetAccountManager.NoOFRetweetPerDay)
{
AddToLog_Tweet("Already Retweeted " + tweetAccountManager.AlreadyRetweeted + " For UserName : " + keyValue.Key);
return;
}
}
else if (!chkboxRetweetPerDay.Checked)
{
TweetAccountManager.RetweetPerDay = false;
}
tweetAccountManager.ReTweet("", retweetMinDealy, retweetMaxDealy);
tweetAccountManager.logEvents.addToLogger -= logEvents_Tweet_addToLogger;
tweetAccountManager.tweeter.logEvents.addToLogger -= logEvents_Tweet_addToLogger;
}
//.........这里部分代码省略.........
示例5: ThreadpoolMethod_Retweet
private void ThreadpoolMethod_Retweet(object parameters)
{
TweetAccountManager tweetAccountManager = new TweetAccountManager();
try
{
Array paramsArray = new object[1];
paramsArray = (Array)parameters;
KeyValuePair<string, TweetAccountManager> keyValue = (KeyValuePair<string, TweetAccountManager>)paramsArray.GetValue(0);
List<TwitterDataScrapper.StructTweetIDs> lst_DivideTweets = new List<TwitterDataScrapper.StructTweetIDs>();
if (TweetAccountManager.IsRetweetDivideRetweet)
{
lst_DivideTweets = (List<TwitterDataScrapper.StructTweetIDs>)paramsArray.GetValue(1);
}
tweetAccountManager = keyValue.Value;
AddToLog_Tweet("[ " + DateTime.Now + " ] => [ Starting ReTweet For Account : " + keyValue.Key + " ]");
//Add to Threads Dictionary
AddThreadToDictionary(strModule(Module.Retweet), tweetAccountManager.Username);
try
{
//Thread.CurrentThread.Name = "ReTweet_" + tweetAccountManager.Username;
//Thread.CurrentThread.IsBackground = true;
//dictionary_Threads.Add("ReTweet_" + tweetAccountManager.Username, Thread.CurrentThread);
AddThreadToDictionary(strModule(Module.Retweet), tweetAccountManager.Username);
}
catch { }
//Create logger Event for lof MSg's .
tweetAccountManager.logEvents.addToLogger += new EventHandler(logEvents_Tweet_addToLogger);
//tweetAccountManager.logEvents.addToLogger += logEvents_Tweet_addToLogger;
tweetAccountManager.tweeter.logEvents.addToLogger += logEvents_Tweet_addToLogger;
if (GlobusRegex.ValidateNumber(txtMinDelay_Tweet.Text))
{
retweetMinDealy = Convert.ToInt32(txtMinDelay_Tweet.Text);
}
if (GlobusRegex.ValidateNumber(txtMaxDelay_Tweet.Text))
{
retweetMaxDealy = Convert.ToInt32(txtMaxDelay_Tweet.Text);
}
if (chkboxRetweetPerDay.Checked)
{
TweetAccountManager.RetweetPerDay = true;
if (!string.IsNullOrEmpty(txtMaximumNoRetweet.Text) && NumberHelper.ValidateNumber(txtMaximumNoRetweet.Text))
{
TweetAccountManager.NoOFRetweetPerDay = Convert.ToInt32(txtMaximumNoRetweet.Text);
}
else
{
TweetAccountManager.NoOFRetweetPerDay = 10;
AddToLog_Tweet("[ " + DateTime.Now + " ] => [ Setting Maximum No Of ReTweets Per Day as 10 ]");
}
clsDBQueryManager DbQueryManager = new clsDBQueryManager();
DataSet Ds = DbQueryManager.SelectMessageData(keyValue.Key, "ReTweet");
int TodayReTweet = Ds.Tables["tb_MessageRecord"].Rows.Count;
tweetAccountManager.AlreadyRetweeted = TodayReTweet;
if (TodayReTweet >= TweetAccountManager.NoOFRetweetPerDay)
{
AddToLog_Tweet("[ " + DateTime.Now + " ] => [ Already Retweeted " + tweetAccountManager.AlreadyRetweeted + " ]");
return;
}
}
if (chkCheckDatabaseInEvery2Minutes.Checked == true || chkAutoFavorite.Checked == true)
{
while (true)
{
try
{
string count_tweet = string.Empty;
string count_tweet1 = string.Empty;
TwitterDataScrapper tweetScrapper = new TwitterDataScrapper();
TwitterDataScrapper.StructTweetIDs item1 = new TwitterDataScrapper.StructTweetIDs();
TweetAccountManager.que_lst_Struct_TweetData.Clear();
Queue<TwitterDataScrapper.StructTweetIDs> tempQueue = new Queue<TwitterDataScrapper.StructTweetIDs>();
TwitterDataScrapper.noOfRecords = 1;
AddToLog_Tweet("[ " + DateTime.Now + " ] => [ Searching tweets for " + keyValue.Key + " ]");
count_tweet = tweetScrapper.countNoOfTweet(txtTweetKeyword.Text.Trim());
startAgain:
TweetAccountManager.static_lst_Struct_TweetData = tweetScrapper.TweetExtractor_ByUserName_New_New(txtTweetKeyword.Text.Trim());
int count = TweetAccountContainer.dictionary_TweetAccount.Count();
foreach (TwitterDataScrapper.StructTweetIDs item in TweetAccountManager.static_lst_Struct_TweetData)
{
//for (int i = 1; i <= count * TweetAccountManager.static_lst_Struct_TweetData.Count(); i++)
{
TweetAccountManager.que_lst_Struct_TweetData.Enqueue(item);
tempQueue.Enqueue(item);
}
//.........这里部分代码省略.........
示例6: ThreadPoolMethod_Reply
private void ThreadPoolMethod_Reply(object parameters)
{
try
{
Array paramsArray = new object[2];
paramsArray = (Array)parameters;
TweetAccountManager keyValue = (TweetAccountManager)paramsArray.GetValue(0);
TweetAccountManager tweetAccountManager = keyValue;//keyValue.Value;
//try
//{
// dictionary_Threads.Add(tweetAccountManager.Username, Thread.CurrentThread);
//}
//catch { };
//Add to Threads Dictionary
AddThreadToDictionary(strModule(Module.Reply), tweetAccountManager.Username);
tweetAccountManager.logEvents.addToLogger += new EventHandler(logEvents_Tweet_addToLogger);
//tweetAccountManager.logEvents.addToLogger += logEvents_Tweet_addToLogger;
tweetAccountManager.tweeter.logEvents.addToLogger += logEvents_Tweet_addToLogger;
if (GlobusRegex.ValidateNumber(txtMinDelay_Tweet.Text))
{
replyMinDealy = Convert.ToInt32(txtMinDelay_Tweet.Text);
}
if (GlobusRegex.ValidateNumber(txtMaxDelay_Tweet.Text))
{
replyMaxDealy = Convert.ToInt32(txtMaxDelay_Tweet.Text);
}
if (chkboxReplyPerDay.Checked)
{
TweetAccountManager.ReplyPerDay = true;
if (!string.IsNullOrEmpty(txtMaximumNoRetweet.Text) && NumberHelper.ValidateNumber(txtMaximumNoRetweet.Text))
{
TweetAccountManager.NoOFReplyPerDay = Convert.ToInt32(txtMaximumNoRetweet.Text);
}
else
{
TweetAccountManager.NoOFReplyPerDay = 10;
AddToTweetCreatorLogs("[ " + DateTime.Now + " ] => [ Adding Default Maximum No Of Retweet 10 ]");
}
clsDBQueryManager DbQueryManager = new clsDBQueryManager();
DataSet Ds = DbQueryManager.SelectMessageData(keyValue.Username, "Reply");
int TodayReply = Ds.Tables["tb_MessageRecord"].Rows.Count;
tweetAccountManager.AlreadyReply = TodayReply;
if (TodayReply >= TweetAccountManager.NoOFReplyPerDay)
{
AddToLog_Tweet("[ " + DateTime.Now + " ] => [ Already Replied " + TodayReply + " ]");
return;
}
}
if (chkCheckDatabaseInEvery2Minutes.Checked == true)
{
while (true)
{
TwitterDataScrapper tweetScrapper = new TwitterDataScrapper();
TwitterDataScrapper.StructTweetIDs item1 = new TwitterDataScrapper.StructTweetIDs();
TweetAccountManager.que_lst_Struct_TweetData.Clear();
Queue<TwitterDataScrapper.StructTweetIDs> tempQueue = new Queue<TwitterDataScrapper.StructTweetIDs>();
TwitterDataScrapper.noOfRecords = 1;
AddToLog_Tweet("[ " + DateTime.Now + " ] => [ Searching tweets for " + keyValue.Username + " ]");
TweetAccountManager.static_lst_Struct_TweetData = tweetScrapper.TweetExtractor_ByUserName_New_New(txtTweetKeyword.Text.Trim());
int count = TweetAccountContainer.dictionary_TweetAccount.Count();
foreach (TwitterDataScrapper.StructTweetIDs item in TweetAccountManager.static_lst_Struct_TweetData)
{
for (int i = 1; i <= count; i++)
{
TweetAccountManager.que_lst_Struct_TweetData.Enqueue(item);
tempQueue.Enqueue(item);
}
}
if (TweetAccountManager.que_lst_Struct_TweetData.Count > 0)
{
item1 = tempQueue.Dequeue();
}
clsDBQueryManager DbQueryManager = new clsDBQueryManager();
DataSet Ds = DbQueryManager.SelectMessageDataForRetweet(keyValue.Username, item1.ID_Tweet, "Reply");
int count_NO_RoWs = Ds.Tables[0].Rows.Count;
if (count_NO_RoWs == 0)
{
tweetAccountManager.Reply(listTweetMessages, replyMinDealy, replyMaxDealy);
}
AddToLog_Tweet("[ " + DateTime.Now + " ] => [ Search tweets after 3 minutes ");
Thread.Sleep(3 * 60 * 1000);
}
}
else
//.........这里部分代码省略.........
示例7: StartTweetingMultithreaded
//.........这里部分代码省略.........
else
{
tweetAccountManager.UseHashTags = false;
}
//Add to Threads Dictionary
AddThreadToDictionary(strModule(Module.Tweet), tweetAccountManager.Username);
///Adding Logs to Logger
tweetAccountManager.tweeter.logEvents.addToLogger += new EventHandler(logEvents_Tweet_addToLogger);
tweetAccountManager.logEvents.addToLogger += logEvents_Tweet_addToLogger;
if (!string.IsNullOrEmpty(txtMinDelay_Tweet.Text) && NumberHelper.ValidateNumber(txtMinDelay_Tweet.Text))
{
tweetMinDealy = Convert.ToInt32(txtMinDelay_Tweet.Text);
}
if (!string.IsNullOrEmpty(txtMaxDelay_Tweet.Text) && NumberHelper.ValidateNumber(txtMaxDelay_Tweet.Text))
{
tweetMaxDealy = Convert.ToInt32(txtMaxDelay_Tweet.Text);
}
//tweetAccountManager.Login();
//tweetAccountManager.Tweet(tweetMessage);
if (ChkboxTweetPerday.Checked)
{
AddToLog_Tweet("[ " + DateTime.Now + " ] => [ Checking Tweets Per Day ]");
TweetAccountManager.NoOfTweetPerDay = 0;
TweetAccountManager.TweetPerDay = true;
if (!string.IsNullOrEmpty(txtMaximumTweet.Text) && NumberHelper.ValidateNumber(txtMaximumTweet.Text))
{
TweetAccountManager.NoOfTweetPerDay = Convert.ToInt32(txtMaximumTweet.Text);
AddToLog_Tweet("[ " + DateTime.Now + " ] => [ " + TweetAccountManager.NoOfTweetPerDay + " Maximum No Of Tweets Per Day ]");
}
else
{
TweetAccountManager.NoOfTweetPerDay = 10;
AddToLog_Tweet("[ " + DateTime.Now + " ] => [ Setting Maximum No Of Tweets Per Day as 10 ]");
}
clsDBQueryManager DbQueryManager = new clsDBQueryManager();
DataSet Ds = DbQueryManager.SelectMessageData(keyValue.Key, "Tweet");
int TodayTweet = Ds.Tables["tb_MessageRecord"].Rows.Count;
tweetAccountManager.AlreadyTweeted = TodayTweet;
AddToLog_Tweet("[ " + DateTime.Now + " ] => [ " + TodayTweet + " Already tweeted today ]");
if (TodayTweet >= TweetAccountManager.NoOfTweetPerDay)
{
AddToLog_Tweet("[ " + DateTime.Now + " ] => [ Already Tweeted " + TweetAccountManager.NoOfTweetPerDay + " ]");
return;
}
}
if (chkAllTweetsPerAccount.Checked)
{
foreach (string item in lst_tweetMessage)
{
tweetAccountManager.que_TweetMessages_PerAccount.Enqueue(item);
}
}
tweetAccountManager.Tweet(lst_tweetMessage, tweetMinDealy, tweetMaxDealy);
//tweetAccountManager.tweeter.logEvents.addToLogger -= logEvents_Tweet_addToLogger;
//tweetAccountManager.logEvents.addToLogger -= logEvents_Tweet_addToLogger;
}
catch (Exception ex)
{
ErrorLogger.AddToErrorLogText(ex.Message);
GlobusFileHelper.AppendStringToTextfileNewLine(DateTime.Now + " --> Error --> StartTweetingMultithreaded() --> " + ex.Message, Globals.Path_TweetingErroLog);
GlobusFileHelper.AppendStringToTextfileNewLine("Error --> StartTweetingMultithreaded() --> " + ex.Message, Globals.Path_TwtErrorLogs);
}
finally
{
counter_AccountFollwer--;
tweetAccountManager.tweeter.logEvents.addToLogger -= logEvents_Tweet_addToLogger;
tweetAccountManager.logEvents.addToLogger -= logEvents_Tweet_addToLogger;
Interlocked.Decrement(ref countTweetMessageAccount);
lock (lockerThreadsTweetFeature)
{
Monitor.Pulse(lockerThreadsTweetFeature);
}
if (counter_AccountFollwer == 0)
{
if (btnStartFollowing.InvokeRequired)
{
Globals.TweetRunningText = string.Empty;
GlobusFileHelper.AppendStringToTextfileNewLine("Module Tweet count Total: " + Globals.totalcountTweet, Globals.path_CountNoOfProcessDone);
btnStartFollowing.Invoke(new MethodInvoker(delegate
{
AddToLog_Follower("[ " + DateTime.Now + " ] => [ PROCESS COMPLETED ]");
AddToLog_Follower("---------------------------------------------------------------------------------------------------------------------------");
}));
}
}
}
}