public void CheckLDAccount(string item) { GlobusHttpHelper objGlobusHttpHelper = new GlobusHttpHelper(); try { LinkedinLogin Login = new LinkedinLogin(); _Email = item; string account = item; string[] AccArr = account.Split(':'); if (AccArr.Count() > 1) { Login.accountUser = account.Split(':')[0]; Login.accountPass = account.Split(':')[1]; //Username = account.Split(':')[0]; //Password = account.Split(':')[1]; int DataCount = account.Split(':').Length; if (DataCount == 4) { Login.proxyAddress = account.Split(':')[2]; Login.proxyPort = account.Split(':')[3]; //proxyAddress = account.Split(':')[2]; //proxyPort = account.Split(':')[3]; } else if (DataCount == 6) { Login.proxyAddress = account.Split(':')[2]; Login.proxyPort = account.Split(':')[3]; Login.proxyUserName = account.Split(':')[4]; Login.proxyPassword = account.Split(':')[5]; //proxyAddress = account.Split(':')[2]; //proxyPort = account.Split(':')[3]; //proxyUserName = account.Split(':')[4]; //proxyPassword = account.Split(':')[5]; } } Login.logger.addToLogger += new EventHandler(logger_addToLogger); Login.LoginHttpHelper_Checker(ref objGlobusHttpHelper); } catch { } finally { Counter++; if (CheckAccount.TotalEmails <= Counter) { AddToListBox("[ " + DateTime.Now + " ] => [ PROCESS COMPLETED For Account Checking ]"); AddToListBox("------------------------------------------------------------------------------------------------------------------------------------"); } } }
public void CheckLDAccount(string item) { GlobusHttpHelper objGlobusHttpHelper = new GlobusHttpHelper(); try { _Email = item; string Username = string.Empty; string Password = string.Empty; string proxyAddress = string.Empty; string proxyPort = string.Empty; string proxyUserName = string.Empty; string proxyPassword = string.Empty; string account = item; string[] AccArr = account.Split(':'); if (AccArr.Count() > 1) { Username = account.Split(':')[0]; Password = account.Split(':')[1]; int DataCount = account.Split(':').Length; if (DataCount == 4) { proxyAddress = account.Split(':')[2]; proxyPort = account.Split(':')[3]; } else if (DataCount == 6) { proxyAddress = account.Split(':')[2]; proxyPort = account.Split(':')[3]; proxyUserName = account.Split(':')[4]; proxyPassword = account.Split(':')[5]; } } LinkedinLogin Login = new LinkedinLogin(); //For Sign Out +9+ Login.LoginHttpHelper(ref objGlobusHttpHelper); //bool isLogin = LoginAccount(Username, Password, proxyAddress, proxyPort, proxyUserName, proxyPassword); } catch { } finally { Counter++; if (TotalEmails <= Counter) { Log("[ " + DateTime.Now + " ] => [ PROCESS COMPLETED For Account Checking ]"); Log("------------------------------------------------------------------------------------------------------------------------------------"); } } }
private void AddaCoverMulti_List(object oo) { try { if (!IsCloseCalledForProfileManager) { try { lstThreadForLinkedInProfileManager.Add(Thread.CurrentThread); lstThreadForLinkedInProfileManager.Distinct(); Thread.CurrentThread.IsBackground = true; } catch { } Array paramArr = new object[2]; paramArr = (Array)oo; LinkedInMaster linkedInMaster = (LinkedInMaster)paramArr.GetValue(0);//KeyValuePair<string, Facebooker> item = (KeyValuePair<string, Facebooker>)paramArr.GetValue(0); // KeyValuePair<string, LinkedInMaster> item = (KeyValuePair<string, LinkedInMaster>)paramArr.GetValue(0); //Facebooker facebooker = item.Value; GlobusHttpHelper HttpHelper = new GlobusHttpHelper(); LinkedinLogin Login = new LinkedinLogin(); string accountUser = linkedInMaster._Username; string accountPass = linkedInMaster._Password; string proxyAddress = linkedInMaster._ProxyAddress; string proxyPort = linkedInMaster._ProxyPort; string proxyUserName = linkedInMaster._ProxyUsername; string proxyPassword = linkedInMaster._ProxyPassword; linkedInMaster.logger.addToLogger += new EventHandler(logger_LinkedInProfileManageraddToLogger); linkedInMaster.LoginHttpHelper(ref HttpHelper); if (linkedInMaster.IsLoggedIn) { LinkedinProfileImgUploader obj_LinkedinProfileManager = new LinkedinProfileImgUploader(accountUser, accountPass, proxyAddress, proxyPort, proxyUserName, proxyPassword); obj_LinkedinProfileManager.LinkedInProfileManagerLogEvents.addToLogger += logger_LinkedInProfileManageraddToLogger; NativeMethods.DeleteUrlCacheEntry("http://www.linkedin.com/"); obj_LinkedinProfileManager.SetProfilePic(ref HttpHelper); NativeMethods.DeleteUrlCacheEntry("http://www.linkedin.com/"); obj_LinkedinProfileManager.LinkedInProfileManagerLogEvents.addToLogger -= new EventHandler(logger_LinkedInProfileManageraddToLogger); } linkedInMaster.logger.addToLogger -= new EventHandler(logger_LinkedInProfileManageraddToLogger); } } catch { } finally { if (!IsCloseCalled) { count_ThreadController--; lock (lockr_ThreadController) { if (!IsCloseCalled) { Monitor.Pulse(lockr_ThreadController); } } } } }
public void SendInviteUsingKeyWords(object Parameter) { try { if (IsStop) { return; } if (!IsStop) { lstSearchconnectionThread.Add(Thread.CurrentThread); lstSearchconnectionThread.Distinct().ToList(); Thread.CurrentThread.IsBackground = true; } } catch { } string Account = string.Empty; Array paramsArray = new object[1]; paramsArray = (Array)Parameter; KeyValuePair <string, LinkedInMaster> item = (KeyValuePair <string, LinkedInMaster>)paramsArray.GetValue(0); int SearchMinDelay = Convert.ToInt32(paramsArray.GetValue(1)); int SearchMaxDelay = Convert.ToInt32(paramsArray.GetValue(2)); GlobusHttpHelper HttpHelper = new GlobusHttpHelper(); LinkedinLogin Login = new LinkedinLogin(); LinkedInMaster LinkedIn_Master = item.Value; string linkedInKey = item.Key; Account = item.Key; Login.logger.addToLogger += new EventHandler(loggerAddConnection_addToLogger); if (chk_InvitePerDay.Checked) { AddLoggerManageConnection("[ " + DateTime.Now + " ] => [ Checking Invites Per Day ]"); SearchCriteria.NumberOfRequestPerKeyword = 0; SearchCriteria.NumberOfrequestPerDay = true; if (!string.IsNullOrEmpty(txt_campMaximumNoRetweet.Text) && NumberHelper.ValidateNumber(txt_campMaximumNoRetweet.Text)) { SearchCriteria.NumberOfRequestPerKeyword = Convert.ToInt32(txt_campMaximumNoRetweet.Text); AddLoggerManageConnection("[ " + DateTime.Now + " ] => [ " + SearchCriteria.NumberOfRequestPerKeyword + " Maximum No Of Invites Per Day ]"); } else { SearchCriteria.NumberOfRequestPerKeyword = 10; AddLoggerManageConnection("[ " + DateTime.Now + " ] => [ Setting Maximum No Of Invites Per Day as 10 ]"); } clsDBQueryManager DbQueryManager = new clsDBQueryManager(); DataSet Ds = DbQueryManager.SearchWithInvite(Account, "SearchWithInvite"); int TodayTweet = Ds.Tables["tb_SearchWithInvite"].Rows.Count; SearchCriteria.AlreadyRequestedUser = TodayTweet; AddLoggerManageConnection("[ " + DateTime.Now + " ] => [ " + TodayTweet + " Already Invites today ]"); if (TodayTweet >= SearchCriteria.NumberOfRequestPerKeyword) { AddLoggerManageConnection("[ " + DateTime.Now + " ] => [ Already Invited : " + SearchCriteria.NumberOfRequestPerKeyword + " ]"); AddLoggerManageConnection("[ " + DateTime.Now + " ] => [ PROCESS COMPLETED ]"); return; } } try { { Queue <string> que_SearchKeywords = new Queue <string>(); foreach (string itemKeyword in _lstConnectionSearchKeyword) { que_SearchKeywords.Enqueue(itemKeyword); } ManageConnections.ConnectUsingSearchKeywod ConnectUsing_Search = new ConnectUsingSearchKeywod(item.Value._Username, item.Value._Password, item.Value._ProxyAddress, item.Value._ProxyPort, item.Value._ProxyUsername, item.Value._ProxyPassword, que_SearchKeywords); ManageConnections.ConnectUsing_Search.SearchUsingkeywordForInvite(ref ConnectUsing_Search, SearchMinDelay, SearchMaxDelay); } } catch (Exception ex) { GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Add Connection --> SendInviteUsingKeyWords() >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs); GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Add Connection --> SendInviteUsingKeyWords() >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinAddConnectionErrorLogs); } finally { counter_Search_connection--; if (counter_Search_connection == 0) { if (btnSearchKeyword.InvokeRequired) { btnSearchKeyword.Invoke(new MethodInvoker(delegate { AddLoggerManageConnection("[ " + DateTime.Now + " ] => [ PROCESS COMPLETED ]"); AddLoggerManageConnection("---------------------------------------------------------------------------------------------------------------------------"); btnSearchKeyword.Cursor = Cursors.Default; })); } } } }
private bool Login_InBoardProGetData() { bool isLoggedin = false; try { try { AddLoggerCompanyEmployeeSearch("[ " + DateTime.Now + " ] => [ Process Running Please wait...]"); if (SearchCriteria.SignIN) { LinkedinLogin Login = new LinkedinLogin(); //For Sign Out Login.LogoutHttpHelper(); SearchCriteria.SignOut = true; } if (SearchCriteria.SignOut) { SearchCriteria.LoginID = string.Empty; if (LinkedInManager.linkedInDictionary.Count() > 0) { try { object temp = null; comboBoxemail.Invoke(new MethodInvoker(delegate { temp = comboBoxemail.SelectedItem; })); if (temp != null) { //GlobusHttpHelper httpHelper = new GlobusHttpHelper(); string acc = ""; comboBoxemail.Invoke(new MethodInvoker(delegate { acc = comboBoxemail.SelectedItem.ToString(); SearchCriteria.LoginID = comboBoxemail.SelectedItem.ToString();//change 21/08/12 })); //string acc = account.Remove(account.IndexOf(':')); //Run a separate thread for each account LinkedInMaster item = null; LinkedInManager.linkedInDictionary.TryGetValue(acc, out item); //item.logger.addToLogger += LinkedinSearchLogEvents_addToLogger; item.LoginHttpHelper(ref HttpHelper); if (item.IsLoggedIn) { AddLoggerCompanyEmployeeSearch("[ " + DateTime.Now + " ] => [ Logged in With : " + acc + " ]"); isLoggedin = true; } if (SearchCriteria.loginREsponce.Contains("Your LinkedIn account has been temporarily restricted")) { AddLoggerCompanyEmployeeSearch("[ " + DateTime.Now + " ] => [ " + SearchCriteria.LoginID + "Your LinkedIn account has been temporarily restricted ]"); } if (SearchCriteria.loginREsponce.Contains("Please confirm your email address")) { AddLoggerCompanyEmployeeSearch("[ " + DateTime.Now + " ] => [ " + SearchCriteria.LoginID + " account has been temporarily restricted Please confirm your email address ]"); } if (!item.IsLoggedIn) { AddLoggerCompanyEmployeeSearch("[ " + DateTime.Now + " ] => [ Couldn't Login With : " + acc + " ]"); } // InBoardPro.LinkedinSearch obj_LinkedinSearch = new InBoardPro.LinkedinSearch(item._Username, item._Password, item._ProxyAddress, item._ProxyPort, item._ProxyUsername, item._ProxyPassword); SearchCriteria.SignIN = true; SearchCriteria.SignOut = false; } } catch (Exception ex) { GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> comboBoxemail_SelectedIndexChanged() >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs); GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> comboBoxemail_SelectedIndexChanged() >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinPreScrapperErrorLogs); } } } } catch { } } catch { } return(isLoggedin); }
public void StartDMMultiThreadedGroupUser(object parameter) { try { Array paramsArray = new object[1]; paramsArray = (Array)parameter; KeyValuePair <string, LinkedInMaster> item = (KeyValuePair <string, LinkedInMaster>)paramsArray.GetValue(0); LinkedinLogin Login = new LinkedinLogin(); Login.accountUser = item.Key; Login.accountPass = item.Value._Password; Login.proxyAddress = item.Value._ProxyAddress; Login.proxyPort = item.Value._ProxyPort; Login.proxyUserName = item.Value._ProxyUsername; Login.proxyPassword = item.Value._ProxyPassword; GlobusHttpHelper HttpHelper = new GlobusHttpHelper(); Groups.GroupUpdate obj_GroupUpdate = new Groups.GroupUpdate(Login.accountUser, Login.accountPass, Login.proxyAddress, Login.proxyPort, Login.proxyUserName, Login.proxyPassword); obj_GroupUpdate.logger.addToLogger += new EventHandler(AddToLogger_GroupStatus); if (!Login.IsLoggedIn) { Login.LoginHttpHelper(ref HttpHelper); AddLoggerCommentLiker("[ " + DateTime.Now + " ] => [ Loggin In With Email : " + item.Value._Username); } AddLoggerCommentLiker("[ " + DateTime.Now + " ] => [ Starting Search For comments >>> To Like ]"); try { if (Login.IsLoggedIn) { GroupStatus dataScrape = new GroupStatus(); Dictionary <string, string> Data = new Dictionary <string, string>(); Data.Clear(); Data = obj_GroupUpdate.PostCommentsForLiker(ref HttpHelper, Login.accountUser); GrpMess.Add(Login.accountUser, Data); obj_GroupUpdate.logger.addToLogger -= new EventHandler(AddToLogger_GroupStatus); if (cmbGroupUser.InvokeRequired) { new Thread(() => { cmbGroupUser.Invoke(new MethodInvoker(delegate { cmbGroupUser.Items.Add(Login.accountUser); })); }).Start(); } AddLoggerCommentLiker("[ " + DateTime.Now + " ] => [ Comment Added in : " + item.Value._Username + " ]"); } else { AddLoggerCommentLiker("[ " + DateTime.Now + " ] => [ LinkedIn account : " + Login.accountUser + " has been temporarily restricted ]"); } } catch (Exception ex) { GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Group Update --> StartDMMultiThreadedGroupUser() >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs); GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Group Update --> StartDMMultiThreadedGroupUser() >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinGetGroupMemberErrorLogs); } finally { counter_GroupMemberSearch--; if (counter_GroupMemberSearch == 0) { if (cmbGroupUser.InvokeRequired) { cmbGroupUser.Invoke(new MethodInvoker(delegate { AddLoggerCommentLiker("[ " + DateTime.Now + " ] => [ PROCESS COMPLETED ]"); AddLoggerCommentLiker("----------------------------------------------------------------------------------------------------------"); cmbGroupUser.Enabled = true; btnGetUser.Cursor = Cursors.Default; })); } } } } catch (Exception ex) { GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Group Update --> StartDMMultiThreadedGroupUser() >>>> " + ex.StackTrace, Globals.Path_LinkedinErrorLogs); GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Group Update --> StartDMMultiThreadedGroupUser() >>>> " + ex.StackTrace, Globals.Path_LinkedinGetGroupMemberErrorLogs); } }
public void StartMultiThreadedPendingGroupAdd(object parameter) { try { Array paramsArray = new object[1]; paramsArray = (Array)parameter; KeyValuePair <string, LinkedInMaster> item = (KeyValuePair <string, LinkedInMaster>)paramsArray.GetValue(0); LinkedinLogin Login = new LinkedinLogin(); Login.accountUser = item.Key; Login.accountPass = item.Value._Password; Login.proxyAddress = item.Value._ProxyAddress; Login.proxyPort = item.Value._ProxyPort; Login.proxyUserName = item.Value._ProxyUsername; Login.proxyPassword = item.Value._ProxyPassword; GlobusHttpHelper HttpHelper = new GlobusHttpHelper(); Login.logger.addToLogger += new EventHandler(GroupStatus_addToLogger); if (!Login.IsLoggedIn) { Login.LoginHttpHelper(ref HttpHelper); } if (Login.IsLoggedIn) { GroupStatus dataScrape = new GroupStatus(); //string MemIdwithuser = dataScrape.GetSelectedID(ref HttpHelper, Login.accountUser); //Dictionary<string, string> Groups = dataScrape.PostAddPendingGroupNames(ref HttpHelper, MemIdwithuser); AddLoggerPendingGroups("[ " + DateTime.Now + " ] => [ Groups Adding of Acount + " + Login.accountUser + " please wait for sometime ]"); Dictionary <string, string> Groups = dataScrape.GetSelectedIDForPendingGroups(ref HttpHelper, Login.accountUser); LinkdInContacts.Add(Login.accountUser, Groups); try { if (Groups.Count > 0) { AddLoggerPendingGroups("[ " + DateTime.Now + " ] => [ Pending Group List..Added Successfully..in " + Login.accountUser + " ]"); } else { AddLoggerPendingGroups("[ " + DateTime.Now + " ] => [ Pending Group List..Not Available..in " + Login.accountUser + " ]"); } } catch (Exception ex) { GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Add Pending Groups --> StartMultiThreadedPendingGroupAdd() >> 1 >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs); GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Add Pending Groups --> StartMultiThreadedPendingGroupAdd() >> 2 >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinPendingGroupErrorLogs); } if (cmbUserPendingGroup.InvokeRequired) { new Thread(() => { cmbUserPendingGroup.Invoke(new MethodInvoker(delegate { cmbUserPendingGroup.Items.Add(Login.accountUser); })); }).Start(); } } else { AddLoggerPendingGroups("[ " + DateTime.Now + " ] => [ LinkedIn Account : " + Login.accountUser + " has been temporarily restricted ]"); } } catch (Exception ex) { GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Add Pending Groups --> StartMultiThreadedPendingGroupAdd() >> 2 >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs); GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Add Pending Groups --> StartMultiThreadedPendingGroupAdd() >> 2>>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinPendingGroupErrorLogs); } finally { counter_GroupPendingSearch--; if (counter_GroupPendingSearch == 0) { if (btnAddPendingGroups.InvokeRequired) { btnAddPendingGroups.Invoke(new MethodInvoker(delegate { btnAddPendingGroups.Enabled = true; AddLoggerPendingGroups("[ " + DateTime.Now + " ] => [ PROCESS COMPLETED ]"); AddLoggerPendingGroups("------------------------------------------------------------------------------------------------------------------------------------"); btnAddPendingGroups.Cursor = Cursors.Default; })); } } } }
private void ResendAccountMultiThread(object Parameter) { try { string account = string.Empty; string tempEmail = string.Empty; string post = string.Empty; Array paramsArray = new object[1]; paramsArray = (Array)Parameter; string item = paramsArray.GetValue(0).ToString(); account = item;//item.Key; GlobusHttpHelper HttpHelper = new GlobusHttpHelper(); LinkedinLogin Login = new LinkedinLogin(); try { string[] arrItem = Regex.Split(item, ":"); tempEmail = arrItem[0]; if (arrItem.Length == 2) { Login.accountUser = arrItem[0]; //item.Key; Login.accountPass = arrItem[1]; //item.Value._Password; } else if (arrItem.Length == 4) { Login.accountUser = arrItem[0]; //item.Key; Login.accountPass = arrItem[1]; //item.Value._Password; Login.proxyAddress = arrItem[2]; //item.Value._ProxyAddress; Login.proxyPort = arrItem[3]; //item.Value._ProxyPort; } else if (arrItem.Length == 6) { Login.accountUser = arrItem[0]; //item.Key; Login.accountPass = arrItem[1]; //item.Value._Password; Login.proxyAddress = arrItem[2]; //item.Value._ProxyAddress; Login.proxyPort = arrItem[3]; //item.Value._ProxyPort; Login.proxyUserName = arrItem[4]; //item.Value._ProxyUsername; Login.proxyPassword = arrItem[5]; //item.Value._ProxyPassword; } else { AddAccountVerificationLogger("[ " + DateTime.Now + " ] => [ Account Not in Correct format " + item + " ]"); } Login.logger.addToLogger += new EventHandler(AccountVerificationLogEvents_addToLogger); Login.LoginHttpHelper(ref HttpHelper); if (Login.IsLoggedIn) { Login.ResendConfirmation(ref HttpHelper); } Login.logger.addToLogger += new EventHandler(AccountVerificationLogEvents_addToLogger); } catch (Exception ex) { Console.WriteLine("Error Resnd Confirmation I >>> " + ex.StackTrace); } } catch (Exception ex) { Console.WriteLine("Error Resnd Confirmation II >>> " + ex.StackTrace); } finally { counter_AccVerification--; if (counter_AccVerification == 0) { btnResendVerfication.Invoke(new MethodInvoker(delegate { AddAccountVerificationLogger("[ " + DateTime.Now + " ] => [ PROCESS COMPLETED ]"); AddAccountVerificationLogger("--------------------------------------------------------------------------------------------------------------------------"); btnResendVerfication.Cursor = Cursors.Default; })); } } }
private void StartAcceptInvitationMultiThread(object Parameter) { string Account = string.Empty; try { try { if (IsStop) { return; } if (!IsStop) { lstThread_AcceptInvitation.Add(Thread.CurrentThread); lstThread_AcceptInvitation = lstThread_AcceptInvitation.Distinct().ToList(); Thread.CurrentThread.IsBackground = true; } } catch { } Array paramsArray = new object[1]; paramsArray = (Array)Parameter; KeyValuePair <string, LinkedInMaster> item = (KeyValuePair <string, LinkedInMaster>)paramsArray.GetValue(0); GlobusHttpHelper HttpHelper = new GlobusHttpHelper(); LinkedinLogin Login = new LinkedinLogin(); LinkedInMaster LinkedIn_Master = item.Value; string linkedInKey = item.Key; Account = item.Key; Login.accountUser = item.Key; Login.accountPass = item.Value._Password; Login.proxyAddress = item.Value._ProxyAddress; Login.proxyPort = item.Value._ProxyPort; Login.proxyUserName = item.Value._ProxyUsername; Login.proxyPassword = item.Value._ProxyPassword; ClsAcceptInvitations obj_ClsAcceptInvitations = new ClsAcceptInvitations(Login.accountUser, Login.accountPass, Login.proxyAddress, Login.proxyPort, Login.proxyUserName, Login.proxyPassword); // Add Event Login.logger.addToLogger += new EventHandler(AcceptInvitationsLogEvents_addToLogger); obj_ClsAcceptInvitations.acceptInvitationsLogEvents.addToLogger += new EventHandler(AcceptInvitationsLogEvents_addToLogger); if (!Login.IsLoggedIn) { //AddAcceptInvitationsLogger("[ " + DateTime.Now + " ] => [ Logging In With Account " + item.Key + " ]"); Login.LoginHttpHelper(ref HttpHelper); } if (Login.IsLoggedIn) { obj_ClsAcceptInvitations.StartAcceptInvitations(ref HttpHelper); } else { AddAcceptInvitationsLogger("[ " + DateTime.Now + " ] => [ Couldn't Login With Account " + item.Key + " ]"); } // Remove Event Login.logger.addToLogger -= new EventHandler(AcceptInvitationsLogEvents_addToLogger); obj_ClsAcceptInvitations.acceptInvitationsLogEvents.addToLogger -= new EventHandler(AcceptInvitationsLogEvents_addToLogger); } catch (Exception ex) { GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Accept Invitation --> StartAcceptInvitation() ---1--->>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs); GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Accept Invitation --> StartAcceptInvitation() ---1--->>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinAddConnectionErrorLogs); } finally { counter_AcceptInvitation--; if (counter_AcceptInvitation == 0) { BtnAccectInvitation.Invoke(new MethodInvoker(delegate { AddAcceptInvitationsLogger("[ " + DateTime.Now + " ] => [ PROCESS COMPLETED ]"); AddAcceptInvitationsLogger("-------------------------------------------------------------------------------------------------------------------"); BtnAccectInvitation.Cursor = Cursors.Default; })); } } }
public void StartDMMultiThreadedMembersGroupScrpAdd(object parameter) { try { try { if (!IsStop) { lstJoinFriendGroupThread.Add(Thread.CurrentThread); lstJoinFriendGroupThread.Distinct().ToList(); Thread.CurrentThread.IsBackground = true; } } catch { } Array paramsArray = new object[1]; paramsArray = (Array)parameter; KeyValuePair <string, LinkedInMaster> item = (KeyValuePair <string, LinkedInMaster>)paramsArray.GetValue(0); LinkedinLogin Login = new LinkedinLogin(); Login.accountUser = item.Key; Login.accountPass = item.Value._Password; Login.proxyAddress = item.Value._ProxyAddress; Login.proxyPort = item.Value._ProxyPort; Login.proxyUserName = item.Value._ProxyUsername; Login.proxyPassword = item.Value._ProxyPassword; GlobusHttpHelper HttpHelper = new GlobusHttpHelper(); string SelectedEmail = string.Empty; this.Invoke(new MethodInvoker(delegate { SelectedEmail = cmbUser.SelectedItem.ToString(); })); if (!Login.IsLoggedIn) { Login.LoginHttpHelper(ref HttpHelper); } AddLoggerGroupAdd("[ " + DateTime.Now + " ] => [ Add Groups Process Running..Please wait.. ]"); if (Login.IsLoggedIn) { List <string> SelectedItem = new List <string>(); try { foreach (KeyValuePair <string, Dictionary <string, string> > UserValue in LinkdInContacts) { string SelectedValue = SelectedEmail; if (UserValue.Key.Contains(SelectedValue)) { foreach (KeyValuePair <string, string> GroupValue in UserValue.Value) { foreach (string Userid in chkMembers.CheckedItems) { if (GroupValue.Value.Replace(",", string.Empty).Contains(Userid)) { MemId.Add(GroupValue.Key.Split(':')[1]); } } } } } } catch (Exception ex) { GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Add Friends Group Scraper --> StartDMMultiThreadedMemmbersGroupAdd() ---1--->>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs); GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Add Friends Group Scraper --> StartDMMultiThreadedMemmbersGroupAdd() ---1--->>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinAddFriendsGroupScraperErrorLogs); } } GroupStatus dataScrape = new GroupStatus(); GroupStatus.loggerFriendsGroup.addToLogger += new EventHandler(GroupStatus_addToLogger); dataScrape.ScrapeFriendsGroup(ref HttpHelper, MemId, Login.accountUser); } catch (Exception ex) { GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Add Friends Group Scraper --> StartDMMultiThreadedMemmbersGroupAdd() ---4--->>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs); GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Add Friends Group Scraper --> StartDMMultiThreadedMemmbersGroupAdd() ---4--->>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinAddFriendsGroupScraperErrorLogs); } finally { this.Invoke(new MethodInvoker(delegate { AddLoggerGroupAdd("[ " + DateTime.Now + " ] => [ PROCESS COMPLETED ]"); AddLoggerGroupAdd("------------------------------------------------------------------------------------------------------------------------------------"); btnLinkedinSearch.Cursor = Cursors.Default; })); } }
public void GetStartProcessForFollow(object paramarray) { string CampaignName = string.Empty; try { Interlocked.Increment(ref counterThreadsCampaignFollow); string Account = string.Empty; Array paramsArray = new object[5]; paramsArray = (Array)paramarray; KeyValuePair <string, CampaignAccountManager> keyValuePair = (KeyValuePair <string, CampaignAccountManager>)paramsArray.GetValue(0); LinkedinLogin Login = new LinkedinLogin(); //KeyValuePair<string, LinkedInMaster> item = (KeyValuePair<string, LinkedInMaster>)paramsArray.GetValue(0); GlobusHttpHelper HttpHelper = new GlobusHttpHelper(); LinkedInMaster LinkedIn_Master1 = new LinkedInMaster(); CampaignAccountManager LinkedIn_Master = keyValuePair.Value; string linkedInKey = keyValuePair.Key; Account = keyValuePair.Key; string SearchType = (string)paramsArray.GetValue(1); int KeywordFilePath = (int)paramsArray.GetValue(2); int UrlFilePath = (int)paramsArray.GetValue(3); int DelayStart = (int)paramsArray.GetValue(4); int DelayEnd = (int)paramsArray.GetValue(5); CampaignName = (string)paramsArray.GetValue(6); bool IsSchedulDaily = (bool)paramsArray.GetValue(7); DateTime SchedulerStartTime = (DateTime)paramsArray.GetValue(7); DateTime SchedulerEndTime = (DateTime)paramsArray.GetValue(8); //bool IsInviteperDay = (bool)paramsArray.GetValue(8); //int NumberOfInivitePerDay = (int)paramsArray.GetValue(9); //string Message = (string)paramsArray.GetValue(10); //bool Isspintax = (bool)paramsArray.GetValue(11); //Initialize Values in Local Variable string accKey = (string)keyValuePair.Key; CampaignAccountManager campACCManager = (CampaignAccountManager)keyValuePair.Value; //Add List Of Working thread //we are using this list when we stop/abort running camp processes.. try { cls_variables.Lst_WokingThreads.Add(CampaignName + "_" + campACCManager.Username, Thread.CurrentThread); } catch (Exception) { } // //////// // JOIN GROUP METHOD!! /////// // } catch (Exception) { } finally { ////count_AccountforCampaignFollower--; //Interlocked.Decrement(ref counterThreadsCampaignFollow); //lock (lockerThreadsCampaignFollow) //{ // Monitor.Pulse(lockerThreadsCampaignFollow); //} if (counterThreadsCampaignFollow == 0) { AddLoggerManageConnection("[ " + DateTime.Now + " ] => [ Process is completed for Campaign " + CampaignName + " ]"); //_IsFollowProcessStart = true; } } }
public void PostAddcompanyUrl(object parameter) { try { try { if (IsStop) { return; } if (!IsStop) { lstLinkedinFollowCompanyUrlThraed.Add(Thread.CurrentThread); lstLinkedinFollowCompanyUrlThraed.Distinct().ToList(); Thread.CurrentThread.IsBackground = true; } } catch { } if (!string.IsNullOrEmpty(txtNumberOfFollowPerAccount.Text) && NumberHelper.ValidateNumber(txtNumberOfFollowPerAccount.Text)) { LinkedinCompanyFollow.CountPerAccount = Convert.ToInt32(txtNumberOfFollowPerAccount.Text); } Array paramsArray = new object[1]; paramsArray = (Array)parameter; KeyValuePair <string, LinkedInMaster> item = (KeyValuePair <string, LinkedInMaster>)paramsArray.GetValue(0); LinkedinLogin Login = new LinkedinLogin(); Login.accountUser = item.Key; Login.accountPass = item.Value._Password; Login.proxyAddress = item.Value._ProxyAddress; Login.proxyPort = item.Value._ProxyPort; Login.proxyUserName = item.Value._ProxyUsername; Login.proxyPassword = item.Value._ProxyPassword; GlobusHttpHelper HttpHelper = new GlobusHttpHelper(); ChilkatHttpHelpr ChilkatHttpHelper = new ChilkatHttpHelpr(); LinkedinCompanyFollow obj_FollowCompany = new LinkedinCompanyFollow(Login.accountUser, Login.accountPass, Login.proxyAddress, Login.proxyPort, Login.proxyUserName, Login.proxyPassword); Login.logger.addToLogger += new EventHandler(logger_SearchFollowCompanyaddToLogger); int minDelay = 20; int maxDelay = 25; if (!string.IsNullOrEmpty(txtFollowCompanyMinDelay.Text) && NumberHelper.ValidateNumber(txtFollowCompanyMinDelay.Text)) { minDelay = Convert.ToInt32(txtFollowCompanyMinDelay.Text); } if (!string.IsNullOrEmpty(txtFollowCompanyMaxDelay.Text) && NumberHelper.ValidateNumber(txtFollowCompanyMaxDelay.Text)) { maxDelay = Convert.ToInt32(txtFollowCompanyMaxDelay.Text); } if (!Login.IsLoggedIn) { Login.LoginHttpHelper(ref HttpHelper); //Login.LoginWithChilkatHelper(ref ChilkatHttpHelper); } if (Login.IsLoggedIn) { LinkedinCompanyFollow LinkdinFollowComp = new LinkedinCompanyFollow(); //LinkdinFollowComp.logger.addToLogger += new EventHandler(logger_SearchFollowCompanyaddToLogger); try { Dictionary <string, string> Result = new Dictionary <string, string>(); string MessagePosted = obj_FollowCompany.PostAddCompanyUsingUrl(ref HttpHelper, Login.accountUser, minDelay, maxDelay); } catch { } } } catch (Exception ex) { GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Manage Follow Company URL --> PostAddcompanyUrl() >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs); GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Manage Follow Company URL --> PostAddcompanyUrl() >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinAddSearchGroupErrorLogs); } finally { counter_AddFollowUrl--; if (counter_AddFollowUrl == 0) { btnFollowCompany.Invoke(new MethodInvoker(delegate { AddLoggerFollowCompanyUrl("[ " + DateTime.Now + " ] => [ PROCESS COMPLETED ]"); AddLoggerFollowCompanyUrl("----------------------------------------------------------------------------------------------------------"); btnFollowCompany.Cursor = Cursors.Default; })); } } }
public void PostAddGroupUrl(object parameter) { try { try { if (IsStop) { return; } if (!IsStop) { lstLinkedinJoinGroupUrlThraed.Add(Thread.CurrentThread); lstLinkedinJoinGroupUrlThraed.Distinct().ToList(); Thread.CurrentThread.IsBackground = true; } } catch { } if (!string.IsNullOrEmpty(txtNumberOfGroupsPerAccount.Text) && NumberHelper.ValidateNumber(txtNumberOfGroupsPerAccount.Text)) { Groups.JoinSearchGroup.CountPerAccount = Convert.ToInt32(txtNumberOfGroupsPerAccount.Text); } Array paramsArray = new object[1]; paramsArray = (Array)parameter; KeyValuePair <string, LinkedInMaster> item = (KeyValuePair <string, LinkedInMaster>)paramsArray.GetValue(0); List <string> lstJoinGroupUrl = (List <string>)paramsArray.GetValue(1); GlobusHttpHelper HttpHelper = new GlobusHttpHelper(); LinkedinLogin Login = new LinkedinLogin(); Login.accountUser = item.Key; Login.accountPass = item.Value._Password; Login.proxyAddress = item.Value._ProxyAddress; Login.proxyPort = item.Value._ProxyPort; Login.proxyUserName = item.Value._ProxyUsername; Login.proxyPassword = item.Value._ProxyPassword; Groups.JoinSearchGroup obj_JoinSearchGroup = new Groups.JoinSearchGroup(Login.accountUser, Login.accountPass, Login.proxyAddress, Login.proxyPort, Login.proxyUserName, Login.proxyPassword); Login.logger.addToLogger += new EventHandler(logger_SearchGroupaddToLogger); int minDelay = 20; int maxDelay = 25; if (!string.IsNullOrEmpty(txtSearchGroupMinDelay.Text) && NumberHelper.ValidateNumber(txtSearchGroupMinDelay.Text)) { minDelay = Convert.ToInt32(txtSearchGroupMinDelay.Text); } if (!string.IsNullOrEmpty(txtSearchGroupMaxDelay.Text) && NumberHelper.ValidateNumber(txtSearchGroupMaxDelay.Text)) { maxDelay = Convert.ToInt32(txtSearchGroupMaxDelay.Text); } //if (lstJoinGroupUrl.Count > 0) //{ // JoinSearchGroup.JoinSearchGroup.lstLinkedinGroupURL = lstJoinGroupUrl; //} if (!Login.IsLoggedIn) { Login.LoginHttpHelper(ref HttpHelper); } if (Login.IsLoggedIn) { GroupStatus dataScrape = new GroupStatus(); Dictionary <string, string> Result = obj_JoinSearchGroup.PostAddOpenGroupsUsingUrl(ref HttpHelper, Login.accountUser, minDelay, maxDelay, lstJoinGroupUrl, IsDevideData); LinkdInContacts.Add(Login.accountUser, Result); } //AddLoggerJoinGroupUrl("[ " + DateTime.Now + " ] => [ Now Joining Groups Process Running ]"); //string MessagePosted = obj_JoinSearchGroup.PostAddGroupUsingUrl(ref HttpHelper,LinkdInContacts, Login.accountUser, Login.accountPass, minDelay, maxDelay); } catch (Exception ex) { GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Add Search Groups --> PostAddSearchGroups() >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs); GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Add Search Groups --> PostAddSearchGroups() >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinAddSearchGroupErrorLogs); } finally { counter_JoinGroupUrlID--; if (counter_JoinGroupUrlID == 0) { btnJoinSearchGroup.Invoke(new MethodInvoker(delegate { AddLoggerJoinGroupUrl("[ " + DateTime.Now + " ] => [ PROCESS COMPLETED ]"); AddLoggerJoinGroupUrl("----------------------------------------------------------------------------------------------------------"); btnJoinSearchGroup.Cursor = Cursors.Default; })); } } }
public void PostUpdateLiker(object parameter) { try { try { if (!IsStop) { lstGroupUpdateThread.Add(Thread.CurrentThread); lstGroupUpdateThread.Distinct().ToList(); Thread.CurrentThread.IsBackground = true; } } catch { } Array paramsArray = new object[1]; paramsArray = (Array)parameter; KeyValuePair <string, LinkedInMaster> item = (KeyValuePair <string, LinkedInMaster>)paramsArray.GetValue(0); GlobusHttpHelper HttpHelper = new GlobusHttpHelper(); LinkedinLogin Login = new LinkedinLogin(); Login.accountUser = item.Key; Login.accountPass = item.Value._Password; Login.proxyAddress = item.Value._ProxyAddress; Login.proxyPort = item.Value._ProxyPort; Login.proxyUserName = item.Value._ProxyUsername; Login.proxyPassword = item.Value._ProxyPassword; string user = item.Key; Groups.GroupUpdate obj_GroupUpdate = new Groups.GroupUpdate(Login.accountUser, Login.accountPass, Login.proxyAddress, Login.proxyPort, Login.proxyUserName, Login.proxyPassword); Login.logger.addToLogger += new EventHandler(AddToLogger_GroupStatus); obj_GroupUpdate.logger.addToLogger += new EventHandler(AddToLogger_GroupStatus); if (!Login.IsLoggedIn) { Login.LoginHttpHelper(ref HttpHelper); //AddLoggerGroupAdd("Login Process completed.. "); } List <string> GetCheckedItems = new List <string>(); if (chkUpdateCollection.InvokeRequired) { chkUpdateCollection.Invoke(new MethodInvoker(delegate { foreach (string Userid in chkUpdateCollection.CheckedItems) { string[] Uid = Userid.Split('#'); GetCheckedItems.Add(Uid[1]); } })); } List <string> SelectedItem = new List <string>(); foreach (KeyValuePair <string, Dictionary <string, string> > NewValue in GrpMess) { if (NewValue.Key == item.Key) { foreach (KeyValuePair <string, string> GroupId in NewValue.Value) { foreach (string selectedgroup in GetCheckedItems) { if (GroupId.Key.Contains(selectedgroup)) { SelectedItem.Add(GroupId + "#" + selectedgroup); } } } } } int minDelay = 20; int maxDelay = 25; if (!string.IsNullOrEmpty(txtGroupUpdateMinDelay.Text) && NumberHelper.ValidateNumber(txtGroupUpdateMinDelay.Text)) { minDelay = Convert.ToInt32(txtGroupUpdateMinDelay.Text); } if (!string.IsNullOrEmpty(txtGroupUpdateMaxDelay.Text) && NumberHelper.ValidateNumber(txtGroupUpdateMaxDelay.Text)) { maxDelay = Convert.ToInt32(txtGroupUpdateMaxDelay.Text); } obj_GroupUpdate.PostCommentLikerUpdate(ref HttpHelper, SelectedItem, new object[] { item, user }, minDelay, maxDelay); } catch (Exception ex) { GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Update Liker --> PostUpdateLiker() >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs); GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Update Liker --> PostUpdateLiker() >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinGetGroupMemberErrorLogs); } finally { counter_GroupMemberSearch--; int cnt = LinkedInManager.linkedInDictionary.Count - 1; if (counter_GroupMemberSearch == cnt) { if (btnUpdateLike.InvokeRequired) { btnUpdateLike.Invoke(new MethodInvoker(delegate { AddLoggerCommentLiker("[ " + DateTime.Now + " ] => [ PROCESS COMPLETED ]"); AddLoggerCommentLiker("---------------------------------------------------------------------------------------------------------------------------"); btnUpdateLike.Cursor = Cursors.Default; })); } } } }
private void AddaCoverMulti_List(object oo) { try { if (!IsCloseCalledForProfileManager) { try { lstThreadForLinkedInProfileManager.Add(Thread.CurrentThread); lstThreadForLinkedInProfileManager.Distinct(); Thread.CurrentThread.IsBackground = true; } catch { } Array paramArr = new object[2]; paramArr = (Array)oo; LinkedInMaster linkedInMaster = (LinkedInMaster)paramArr.GetValue(0);//KeyValuePair<string, Facebooker> item = (KeyValuePair<string, Facebooker>)paramArr.GetValue(0); // KeyValuePair<string, LinkedInMaster> item = (KeyValuePair<string, LinkedInMaster>)paramArr.GetValue(0); //Facebooker facebooker = item.Value; GlobusHttpHelper HttpHelper = new GlobusHttpHelper(); LinkedinLogin Login = new LinkedinLogin(); string accountUser = linkedInMaster._Username; string accountPass = linkedInMaster._Password; string proxyAddress = linkedInMaster._ProxyAddress; string proxyPort = linkedInMaster._ProxyPort; string proxyUserName = linkedInMaster._ProxyUsername; string proxyPassword = linkedInMaster._ProxyPassword; if (!Login.IsLoggedIn) { //Login.LoginHttpHelper(ref HttpHelper); Login.logger.addToLogger += new EventHandler(logger_LinkedInProfileManageraddToLogger); Login.LoginHttpHelper(ref HttpHelper, accountUser, accountPass, proxyAddress, proxyUserName, proxyPassword, proxyPort); } if (Login.IsLoggedIn) { LinkedinProfileImgUploader obj_LinkedinProfileManager = new LinkedinProfileImgUploader(accountUser, accountPass, proxyAddress, proxyPort, proxyUserName, proxyPassword); ////facebooker.loginChecker.pumpMessageEvent.addToLogger += ProfileManagerLogEvents_addToLogger; obj_LinkedinProfileManager.LinkedInProfileManagerLogEvents.addToLogger += new EventHandler(logger_LinkedInProfileManageraddToLogger); //facebooker.StartAddaCover(ref obj_AddaCover, lstCoverPics); obj_LinkedinProfileManager.SetProfilePic(ref HttpHelper); ////facebooker.loginChecker.pumpMessageEvent.addToLogger -= ProfileManagerLogEvents_addToLogger; Login.logger.addToLogger -= new EventHandler(logger_LinkedInProfileManageraddToLogger); obj_LinkedinProfileManager.LinkedInProfileManagerLogEvents.addToLogger -= new EventHandler(logger_LinkedInProfileManageraddToLogger); } else { AddLoggerLinkedInProfileManager("[ " + DateTime.Now + " ] => [ Couldn't Login With Username >>> " + accountUser + " ]"); return; } } } catch { } finally { if (!IsCloseCalled) { count_ThreadController--; lock (lockr_ThreadController) { if (!IsCloseCalled) { Monitor.Pulse(lockr_ThreadController); } } } } }
//****************for Search Group**********************// #region AddSearchGroup public void AddSearchGroup(ref GlobusHttpHelper GlobusHttpHelper, string Email, string Password, string proxyAddress, int ProxyPort, string proxyUsername, string proxyPassword) { LinkedinLogin Login = new LinkedinLogin(); try { if (!string.IsNullOrEmpty(CampainGroupCreate.GroupCount) && NumberHelper.ValidateNumber(CampainGroupCreate.GroupCount)) { Groups.JoinSearchGroup.BoxGroupCount = Convert.ToInt32(CampainGroupCreate.GroupCount); } else { if (string.IsNullOrEmpty(CampainGroupCreate.GroupCount)) { } else { MessageBox.Show("Enter No. of Group in Numeric Form !"); return; } } lstJoinSearchGroupThread.Clear(); if (CampainGroupCreate.SearchKeyword == string.Empty) { AddLoggerLinkedInProfileManager("[ " + DateTime.Now + " ] => [ Please Enter Keyword to Search.. ]"); MessageBox.Show("Please Enter Keyword to Search.."); txtSearchKeyword.Focus(); return; } AddLoggerLinkedInProfileManager("[ " + DateTime.Now + " ] => [ Starting Search for Groups.. ]"); Login.accountUser = Email; Login.accountPass = Password; Login.proxyAddress = proxyAddress; Login.proxyPort = ProxyPort.ToString(); Login.proxyUserName = proxyUsername; Login.proxyPassword = proxyPassword; Groups.JoinSearchGroup obj_JoinSearchGroup = new Groups.JoinSearchGroup(Email, Password, proxyAddress, ProxyPort.ToString(), proxyUsername, proxyPassword); obj_JoinSearchGroup.logger.addToLogger += new EventHandler(logger_LinkedInProfileManageraddToLogger); GlobusHttpHelper HttpHelper = new GlobusHttpHelper(); if (!Login.IsLoggedIn) { Login.LoginHttpHelper(ref HttpHelper); AddLoggerLinkedInProfileManager("[ " + DateTime.Now + " ] => [ Logging In With Email : " + Email + " ]"); } AddLoggerLinkedInProfileManager("[ " + DateTime.Now + " ] => [ Searching Groups Process Running..Please wait.. ]"); if (Login.IsLoggedIn) { GroupStatus dataScrape = new GroupStatus(); try { CampainGroupCreate.Result = obj_JoinSearchGroup.PostAddOpenGroups(ref HttpHelper, CampainGroupCreate.SearchKeyword.ToString().Trim(), Email); int count = 5; if (!string.IsNullOrEmpty(CampainGroupCreate.GroupCount) && NumberHelper.ValidateNumber(CampainGroupCreate.GroupCount)) { count = Convert.ToInt32(CampainGroupCreate.GroupCount); } CampainGroupCreate.LinkdInContacts.Add(Login.accountUser, CampainGroupCreate.Result); } catch (Exception ex) { GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Add Search Groups --> --1--->>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs); GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Add Search Groups --> --1--->>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinAddSearchGroupErrorLogs); } if (CampainGroupCreate.Result.Count == 0) { AddLoggerLinkedInProfileManager("[ " + DateTime.Now + " ] => [ Sorry, there are no group Search results matching your search criteria.. ]"); } else { AddLoggerLinkedInProfileManager("[ " + DateTime.Now + " ] => [ Groups..Searched Successfully..For " + Login.accountUser + " ]"); } foreach (var item in CampainGroupCreate.Result) { CampainGroupCreate.lstSearchGroup.Add(item.Key + ":" + item.Value); } AddLoggerLinkedInProfileManager("[ " + DateTime.Now + " ] => [ Now Joining Groups ]"); string MessagePosted = obj_JoinSearchGroup.PostSearchGroupAddFinal(ref HttpHelper, Email, Password, CampainGroupCreate.lstSearchGroup, 0, 0); Login.logger.addToLogger -= new EventHandler(logger_LinkedInProfileManageraddToLogger); obj_JoinSearchGroup.logger.addToLogger -= new EventHandler(logger_LinkedInProfileManageraddToLogger); } } catch (Exception ex) { GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Add Search Groups --> btnAddSearchGroup_Click() >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs); GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Add Search Groups --> btnAddSearchGroup_Click() >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinAddSearchGroupErrorLogs); } }
public void PostStatusImageShare(object Parameter) { try { if (IsStop) { return; } if (!IsStop) { Thread.CurrentThread.Name = "StatusImageShareThread"; lstThreadForStatusImage.Add(Thread.CurrentThread); lstThreadForStatusImage.Distinct().ToList(); Thread.CurrentThread.IsBackground = true; } } catch { } string account = string.Empty; try { string post = string.Empty; Array paramsArray = new object[1]; paramsArray = (Array)Parameter; KeyValuePair <string, LinkedInMaster> item = (KeyValuePair <string, LinkedInMaster>)paramsArray.GetValue(0); account = item.Key; GlobusHttpHelper HttpHelper = new GlobusHttpHelper(); LinkedinLogin Login = new LinkedinLogin(); Login.accountUser = item.Key; Login.accountPass = item.Value._Password; Login.proxyAddress = item.Value._ProxyAddress; Login.proxyPort = item.Value._ProxyPort; Login.proxyUserName = item.Value._ProxyUsername; Login.proxyPassword = item.Value._ProxyPassword; Others.StatusUpdate obj_StatusUpdate = new Others.StatusUpdate(Login.accountUser, Login.accountPass, Login.proxyAddress, Login.proxyPort, Login.proxyUserName, Login.proxyPassword); Login.logger.addToLogger += new EventHandler(logger_LinkedInStatusImageToLogger); obj_StatusUpdate.logger.addToLogger += new EventHandler(logger_LinkedInStatusImageToLogger); if (!Login.IsLoggedIn) { Login.LoginHttpHelper(ref HttpHelper); } if (!Login.IsLoggedIn) { AddToLogStatusImage("[ " + DateTime.Now + " ] => [ Couldn't Login With Username >>> " + Login.accountUser + " ]"); return; } if (Login.IsLoggedIn) { lock (LinkedinLogin.Locker_Message_Post) { if (ClsStatusImageShare.lstpicfile.Count > 1) { if (Others.StatusUpdate.Que_Message_Post.Count > 0) { obj_StatusUpdate.Post = Others.StatusUpdate.Que_Message_Post.Dequeue(); } else { AddToLogStatusImage("[ " + DateTime.Now + " ] => [ All Loaded Post Updates ]"); return; } } else { obj_StatusUpdate.Post = ClsStatusImageShare.lstpicfile[0]; } } int minDelay = 20; int maxDelay = 25; if (!string.IsNullOrEmpty(txtStatusUpdateMinDelay.Text) && NumberHelper.ValidateNumber(txtStatusUpdateMinDelay.Text)) { minDelay = Convert.ToInt32(txtStatusUpdateMinDelay.Text); } if (!string.IsNullOrEmpty(txtStatusUpdateMaxDelay.Text) && NumberHelper.ValidateNumber(txtStatusUpdateMaxDelay.Text)) { maxDelay = Convert.ToInt32(txtStatusUpdateMaxDelay.Text); } try { obj_StatusUpdate.UpdateStatusUsingAllurl(ref HttpHelper, minDelay, maxDelay); } catch { } } Login.logger.addToLogger -= new EventHandler(logger_LinkedInStatusImageToLogger); obj_StatusUpdate.logger.addToLogger -= new EventHandler(logger_LinkedInStatusImageToLogger); } catch (Exception ex) { GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> LinkdinStatusImageShare --> PostStatusImageShare() >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs); GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> LinkdinStatusImageShare --> PostStatusImageShare() >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinStatusImageUpdateErrorLogs); } finally { counter_status_posting--; if (counter_status_posting == 0) { if (btnAddStatusImage.InvokeRequired) { btnAddStatusImage.Invoke(new MethodInvoker(delegate { AddToLogStatusImage("[ " + DateTime.Now + " ] => [ PROCESS COMPLETED ]"); AddToLogStatusImage("-------------------------------------------------------------------------------------------------------------------------------"); //btnStatusPost.Cursor = Cursors.Default; })); } } } }
private void VerifyAccountMultiThread(object Parameter) { string account = string.Empty; string tempEmail = string.Empty; try { if (!IsStop) { lstThread_AccountVerification.Add(Thread.CurrentThread); lstThread_AccountVerification.Distinct().ToList(); Thread.CurrentThread.IsBackground = true; } if (IsStop) { return; } } catch { } try { string post = string.Empty; Array paramsArray = new object[1]; paramsArray = (Array)Parameter; //KeyValuePair<string, LinkedInMaster> item = (KeyValuePair<string, LinkedInMaster>)paramsArray.GetValue(0); string item = paramsArray.GetValue(0).ToString(); account = item;//item.Key; GlobusHttpHelper HttpHelper = new GlobusHttpHelper(); LinkedinLogin Login = new LinkedinLogin(); try { string[] arrItem = Regex.Split(item, ":"); tempEmail = arrItem[0]; if (arrItem.Length == 2) { Login.accountUser = arrItem[0]; //item.Key; Login.accountPass = arrItem[1]; //item.Value._Password; } else if (arrItem.Length == 4) { Login.accountUser = arrItem[0]; //item.Key; Login.accountPass = arrItem[1]; //item.Value._Password; Login.proxyAddress = arrItem[2]; //item.Value._ProxyAddress; Login.proxyPort = arrItem[3]; } else if (arrItem.Length == 6) { Login.accountUser = arrItem[0]; //item.Key; Login.accountPass = arrItem[1]; //item.Value._Password; Login.proxyAddress = arrItem[2]; //item.Value._ProxyAddress; Login.proxyPort = arrItem[3]; //item.Value._ProxyPort; Login.proxyUserName = arrItem[4]; //item.Value._ProxyUsername; Login.proxyPassword = arrItem[5]; //item.Value._ProxyPassword; } else { AddAccountVerificationLogger("[ " + DateTime.Now + " ] => [ Wrong Format For Email Password ]"); return; } } catch (Exception ex) { Console.WriteLine("Error >>> " + ex.StackTrace); } ClsEmailActivator obj_ClsEmailActivator = new ClsEmailActivator(Login.accountUser, Login.accountPass, Login.proxyAddress, Login.proxyPort, Login.proxyUserName, Login.proxyPassword); Login.logger.addToLogger += new EventHandler(AccountVerificationLogEvents_addToLogger); //obj_StatusUpdate.logger.addToLogger += new EventHandler(logger_StatusUpdateaddToLogger); if (!Login.IsLoggedIn) { Login.LoginHttpHelper(ref HttpHelper); } if (!Login.IsLoggedIn) { AddAccountVerificationLogger("[ " + DateTime.Now + " ] => [ Couldn't Login With Username >>> " + Login.accountUser + " ]"); return; } if (Login.IsLoggedIn) { bool isActivated = obj_ClsEmailActivator.EmailVerification(Login.accountUser, Login.accountPass, ref HttpHelper); if (isActivated) { AddAccountVerificationLogger("[ " + DateTime.Now + " ] => [ Account Activated With Username : "******" ]"); GlobusFileHelper.AppendStringToTextfileNewLine(Login.accountUser + ":" + Login.accountPass + ":" + Login.proxyAddress + ":" + Login.proxyPort + ":" + Login.proxyUserName + ":" + Login.proxyPassword, Globals.path_VerifiedAccounts); } else { AddAccountVerificationLogger("[ " + DateTime.Now + " ] => [ Account Couldn't Activated With Username >>> " + Login.accountUser + " ]"); GlobusFileHelper.AppendStringToTextfileNewLine(Login.accountUser + ":" + Login.accountPass + ":" + Login.proxyAddress + ":" + Login.proxyPort + ":" + Login.proxyUserName + ":" + Login.proxyPassword, Globals.path_NonVerifiedAccounts); } Login.logger.addToLogger -= new EventHandler(AccountVerificationLogEvents_addToLogger); } AddAccountVerificationLogger("[ " + DateTime.Now + " ] => [ Process Completed With Username : "******" ]"); } catch (Exception ex) { Console.WriteLine("Error >>> " + ex.StackTrace); } finally { counter_AccVerification--; if (counter_AccVerification == 0) { btnAccountVerification_AccountVerification.Invoke(new MethodInvoker(delegate { AddAccountVerificationLogger("[ " + DateTime.Now + " ] => [ PROCESS COMPLETED ]"); AddAccountVerificationLogger("--------------------------------------------------------------------------------------------------------------------------"); btnAccountVerification_AccountVerification.Cursor = Cursors.Default; })); } } }
private void LoginUsingInputData(object Parameter) { try { if (!IsStopScrapper) { lstScrapperStopThread.Add(Thread.CurrentThread); lstScrapperStopThread.Distinct(); Thread.CurrentThread.IsBackground = true; } string account = string.Empty; string post = string.Empty; Array paramsArray = new object[1]; paramsArray = (Array)Parameter; KeyValuePair <string, LinkedInMaster> item = (KeyValuePair <string, LinkedInMaster>)paramsArray.GetValue(0); account = item.Key; try { account = account.Split(':')[0]; } catch { } GlobusHttpHelper HttpHelper = new GlobusHttpHelper(); LinkedinLogin Login = new LinkedinLogin(); Login.accountUser = account; Login.accountPass = item.Value._Password; Login.proxyAddress = item.Value._ProxyAddress; Login.proxyPort = item.Value._ProxyPort; Login.proxyUserName = item.Value._ProxyUsername; Login.proxyPassword = item.Value._ProxyPassword; Login.Postalcode = item.Value._Postalcode; Login.Distance = item.Value._Distance; Login.IndustryType = item.Value._IndustryType; Login.LastName = item.Value._LastName; // StatusUpdate.StatusUpdate obj_StatusUpdate = new StatusUpdate.StatusUpdate(Login.accountUser, Login.accountPass, Login.proxyAddress, Login.proxyPort, Login.proxyUserName, Login.proxyPassword); InBoardPro.LinkinScrappRecord obj_Scrapper = new InBoardPro.LinkinScrappRecord(Login.accountUser, Login.accountPass, Login.proxyAddress, Login.proxyPort, Login.proxyUserName, Login.proxyPassword, Login.Postalcode, Login.Distance, Login.IndustryType, Login.LastName); //Login.logger.addToLogger += new EventHandler(logger_StatusUpdateaddToLogger); //obj_StatusUpdate.logger.addToLogger += new EventHandler(logger_StatusUpdateaddToLogger); obj_Scrapper.InBoardProGetDataResultLogEvents.addToLogger += ScrapperRecordsLogEvents_addToLogger; Login.logger.addToLogger += new EventHandler(ScrapperRecordsLogEvents_addToLogger); if (!Login.IsLoggedIn) { // AddLoggerScrapData("Logging With : " + Login.accountUser); Login.LoginHttpHelper(ref HttpHelper); } try { if (Login.IsLoggedIn) { // AddLoggerScrapData("LoggedIn With : " + Login.accountUser); obj_Scrapper.lastName = Login.LastName; obj_Scrapper.industryType = Login.IndustryType; obj_Scrapper.postalCode = Login.Postalcode; obj_Scrapper.GetRecords1(ref HttpHelper); } } catch { } obj_Scrapper.InBoardProGetDataResultLogEvents.addToLogger -= ScrapperRecordsLogEvents_addToLogger; Login.logger.addToLogger -= new EventHandler(ScrapperRecordsLogEvents_addToLogger); } catch { } finally { AddLoggerScrapData("[ " + DateTime.Now + " ] => [ PROCESS COMPLETED ]"); AddLoggerScrapData("----------------------------------------------------------------------------------------------------------------------------"); } }
private void StartScarppLoginUsingInputData(object Parameter) { try { if (!IsStopScrapper) { lstScrapperStopThread.Add(Thread.CurrentThread); lstScrapperStopThread.Distinct(); Thread.CurrentThread.IsBackground = true; } try { InBoardPro.StartLinkedinScrapping.lstNumberOfThreads = lstScrapperStopThread; } catch { } string account = string.Empty; string post = string.Empty; Array paramsArray = new object[1]; paramsArray = (Array)Parameter; KeyValuePair <string, LinkedInMaster> item = (KeyValuePair <string, LinkedInMaster>)paramsArray.GetValue(0); account = item.Key; try { account = account.Split(':')[0]; } catch { } GlobusHttpHelper HttpHelper = new GlobusHttpHelper(); LinkedinLogin Login = new LinkedinLogin(); Login.accountUser = account; Login.accountPass = item.Value._Password; Login.proxyAddress = item.Value._ProxyAddress; Login.proxyPort = item.Value._ProxyPort; Login.proxyUserName = item.Value._ProxyUsername; Login.proxyPassword = item.Value._ProxyPassword; Login.Postalcode = item.Value._Postalcode; Login.Distance = item.Value._Distance; Login.IndustryType = item.Value._IndustryType; Login.LastName = item.Value._LastName; InBoardPro.StartLinkedinScrapping objstartscrapp = new InBoardPro.StartLinkedinScrapping(); objstartscrapp.InBoardProGetDataLogEvents.addToLogger += ScrapperLogEvents_addToLogger; Login.logger.addToLogger += new EventHandler(ScrapperLogEvents_addToLogger); if (!Login.IsLoggedIn) { try { Login.LoginHttpHelper(ref HttpHelper); } catch { } } try { if (Login.IsLoggedIn) { objstartscrapp.ParsingOfInBoardProGetData(ref HttpHelper, Login.accountUser, Login.accountPass, Login.proxyAddress, Login.proxyPort, Login.proxyUserName, Login.proxyPassword, Login.Postalcode, Login.Distance, Login.IndustryType, Login.LastName); } } catch { } objstartscrapp.InBoardProGetDataLogEvents.addToLogger -= ScrapperLogEvents_addToLogger; Login.logger.addToLogger -= new EventHandler(ScrapperLogEvents_addToLogger); } catch { } }
private void StartSendInvitationMultyThread_DivideUrlsAccordingAccount(object Parameter) { string Account = string.Empty; List <string> lstProfileUrl = new List <string>(); try { try { if (IsStop) { return; } if (!IsStop) { lstThread_AcceptInvitation.Add(Thread.CurrentThread); lstThread_AcceptInvitation = lstThread_AcceptInvitation.Distinct().ToList(); Thread.CurrentThread.IsBackground = true; } } catch { } Array paramsArray = new object[2]; paramsArray = (Array)Parameter; // KeyValuePair<string, LinkedInMaster> item = (KeyValuePair<string, LinkedInMaster>)paramsArray.GetValue(0); lstProfileUrl = (List <string>)paramsArray.GetValue(1); GlobusHttpHelper HttpHelper = new GlobusHttpHelper(); LinkedinLogin Login = new LinkedinLogin(); LinkedInMaster item = (LinkedInMaster)paramsArray.GetValue(0); //item.Value; //string linkedInKey = item.Key; //Account = item.Key; //Login.accountUser = item.Key; //Login.accountPass = item.Value._Password; //Login.proxyAddress = item.Value._ProxyAddress; //Login.proxyPort = item.Value._ProxyPort; //Login.proxyUserName = item.Value._ProxyUsername; //Login.proxyPassword = item.Value._ProxyPassword; Login.accountUser = item._Username; Login.accountPass = item._Password; Login.proxyAddress = item._ProxyAddress; Login.proxyPort = item._ProxyPort; Login.proxyUserName = item._ProxyUsername; Login.proxyPassword = item._ProxyPassword; ClsInviteMemberThroughProfileURL obj_ClsInviteMemberThroughProfileURL = new ClsInviteMemberThroughProfileURL(Login.accountUser, Login.accountPass, Login.proxyAddress, Login.proxyPort, Login.proxyUserName, Login.proxyPassword); // Add Event Login.logger.addToLogger += new EventHandler(AcceptInvitationsLogEvents_addToLogger); obj_ClsInviteMemberThroughProfileURL.acceptInvitationsLogEvents.addToLogger += new EventHandler(AcceptInvitationsLogEvents_addToLogger); if (!Login.IsLoggedIn) { // AddAcceptInvitationsLogger("Logging In With Account" + Login.accountUser); Login.LoginHttpHelper(ref HttpHelper); } if (Login.IsLoggedIn) { obj_ClsInviteMemberThroughProfileURL.StartSendInvitations_DivideUrlsAccordingAccount(ref HttpHelper, lstProfileUrl); } else { AddInviteMemberThroughProfUrlLogger("[ " + DateTime.Now + " ] => [ Couldn't Login With Account " + Login.accountUser + " ]"); } // Remove Event Login.logger.addToLogger -= new EventHandler(AcceptInvitationsLogEvents_addToLogger); obj_ClsInviteMemberThroughProfileURL.acceptInvitationsLogEvents.addToLogger -= new EventHandler(AcceptInvitationsLogEvents_addToLogger); } catch (Exception ex) { GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Accept Invitation --> StartAcceptInvitation() ---1--->>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs); GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Accept Invitation --> StartAcceptInvitation() ---1--->>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinAddConnectionErrorLogs); } finally { lock (lockr_ThreadController) { count_ThreadController--; Monitor.Pulse(lockr_ThreadController); } } }
public void PostRemovePendingGroups(object parameter) { try { try { if (IsStop) { return; } if (!IsStop) { lstRemovePendingGroupThread.Add(Thread.CurrentThread); lstRemovePendingGroupThread.Distinct().ToList(); Thread.CurrentThread.IsBackground = true; } } catch { } Array paramsArray = new object[1]; paramsArray = (Array)parameter; KeyValuePair <string, LinkedInMaster> item = (KeyValuePair <string, LinkedInMaster>)paramsArray.GetValue(0); GlobusHttpHelper HttpHelper = new GlobusHttpHelper(); LinkedinLogin Login = new LinkedinLogin(); Login.accountUser = item.Key; Login.accountPass = item.Value._Password; Login.proxyAddress = item.Value._ProxyAddress; Login.proxyPort = item.Value._ProxyPort; Login.proxyUserName = item.Value._ProxyUsername; Login.proxyPassword = item.Value._ProxyPassword; GroupStatus obj_GroupStatus = new GroupStatus(); obj_GroupStatus = new GroupStatus(Login.accountUser, Login.accountPass, Login.proxyAddress, Login.proxyPort, Login.proxyUserName, Login.proxyPassword); obj_GroupStatus.loggerRemPendingGroup.addToLogger += new EventHandler(GroupStatus_addToLogger); if (!Login.IsLoggedIn) { Login.LoginHttpHelper(ref HttpHelper); } List <string> SelectedItem = new List <string>(); try { if (label1.Text == Login.accountUser) { #region old commented code //if (IsallaccChecked) //{ // try // { // foreach (string SelectedGrp in chkPendingGroup.CheckedItems) // { // foreach (var itemID in LinkdInContacts) // { // if (SelectedGrp.Split(':')[0] == itemID.Key) // { // if (label1.Text == itemID.Key) // { // foreach (KeyValuePair<string, string> itemGid in itemID.Value) // { // if (SelectedGrp.Split(':')[1] == itemGid.Key.Split(':')[1]) // { // try // { // lstPendingGroup.Add(itemGid.Key + ":" + itemGid.Value); // } // catch // { // } // } // } // } // } // } // } // if (lstPendingGroup.Count > 0) // { // try // { // GroupStatus.lstPendingGroup = lstPendingGroup; // } // catch // { // } // } // int minDelay = 20; // int maxDelay = 25; // if (!string.IsNullOrEmpty(txtPendingGroupMinDelay.Text) && NumberHelper.ValidateNumber(txtPendingGroupMinDelay.Text)) // { // minDelay = Convert.ToInt32(txtPendingGroupMinDelay.Text); // } // if (!string.IsNullOrEmpty(txtPendingGroupMaxDelay.Text) && NumberHelper.ValidateNumber(txtPendingGroupMaxDelay.Text)) // { // maxDelay = Convert.ToInt32(txtPendingGroupMaxDelay.Text); // } // string MessagePosted = obj_GroupStatus.PostRemovePendingGroups(Login.accountUser, Login.accountPass, minDelay, maxDelay); // Thread.Sleep(2000); // } // catch // { // } //} //else //{ #endregion try { foreach (string SelectedGrp in chkPendingGroup.CheckedItems) { foreach (var itemID in LinkdInContacts) { foreach (KeyValuePair <string, string> itemGid in itemID.Value) { if (SelectedGrp.Split(':')[1] == itemID.Key) { if (SelectedGrp.Split(':')[0] == itemGid.Key.Split(':')[0]) { try { lstPendingGroup.Add(itemGid.Key + ":" + itemGid.Value); } catch { } } } } } } if (lstPendingGroup.Count > 0) { try { GroupStatus.lstPendingGroup = lstPendingGroup; } catch { } } int minDelay = 20; int maxDelay = 25; if (!string.IsNullOrEmpty(txtPendingGroupMinDelay.Text) && NumberHelper.ValidateNumber(txtPendingGroupMinDelay.Text)) { minDelay = Convert.ToInt32(txtPendingGroupMinDelay.Text); } if (!string.IsNullOrEmpty(txtPendingGroupMaxDelay.Text) && NumberHelper.ValidateNumber(txtPendingGroupMaxDelay.Text)) { maxDelay = Convert.ToInt32(txtPendingGroupMaxDelay.Text); } string MessagePosted = obj_GroupStatus.PostRemovePendingGroups(Login.accountUser, Login.accountPass, minDelay, maxDelay); Thread.Sleep(2000); } catch { } //} } } catch (Exception ex) { GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Add Pending Groups --> PostRemovePendingGroups() ---1--->>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs); GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Add Pending Groups --> PostRemovePendingGroups() ---1--->>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinPendingGroupErrorLogs); } } catch (Exception ex) { GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Add Friends Groups --> PostAddGroups() ---2--->>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs); GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Add Friends Groups --> PostAddGroups() ---2--->>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinPendingGroupErrorLogs); } finally { counter_PendGroupRemoved--; if (counter_PendGroupRemoved == 0) { if (btnRemovePendingGroup.InvokeRequired) { btnRemovePendingGroup.Invoke(new MethodInvoker(delegate { AddLoggerPendingGroups("[ " + DateTime.Now + " ] => [ PROCESS COMPLETED ]"); AddLoggerPendingGroups("------------------------------------------------------------------------------------------------------------------------------------"); btnRemovePendingGroup.Enabled = true; btnRemovePendingGroup.Cursor = Cursors.Default; })); } } } }
private void LoginForAddExperience(object Parameter) { try { if (IsStopAddExperience) { return; } if (!IsStopAddExperience) { lstThreadforAddExperience.Add(Thread.CurrentThread); lstThreadforAddExperience.Distinct(); Thread.CurrentThread.IsBackground = true; } string account = string.Empty; string post = string.Empty; Array paramsArray = new object[1]; paramsArray = (Array)Parameter; KeyValuePair <string, LinkedInMaster> item = (KeyValuePair <string, LinkedInMaster>)paramsArray.GetValue(0); account = item.Key; GlobusHttpHelper HttpHelper = new GlobusHttpHelper(); LinkedinLogin Login = new LinkedinLogin(); Login.accountUser = item.Key; Login.accountPass = item.Value._Password; Login.proxyAddress = item.Value._ProxyAddress; Login.proxyPort = item.Value._ProxyPort; Login.proxyUserName = item.Value._ProxyUsername; Login.proxyPassword = item.Value._ProxyPassword; ProfileManager.ProfileManager objAddExperience = new ProfileManager.ProfileManager(Login.accountUser, Login.accountPass, Login.proxyAddress, Login.proxyPort, Login.proxyUserName, Login.proxyPassword); objAddExperience.LinkedInAddExperienceLogEvents.addToLogger += ScrapperRecordsLogEvents_addToLogger; Login.logger.addToLogger += new EventHandler(ScrapperRecordsLogEvents_addToLogger); if (!Login.IsLoggedIn) { Login.LoginHttpHelper(ref HttpHelper); } try { if (Login.IsLoggedIn) { AddExperienceLogger("[ " + DateTime.Now + " ] => [ Logged In With " + item.Key + " , Adding Experience ]"); objAddExperience.AddExperience(ref HttpHelper); } } catch { } objAddExperience.LinkedInAddExperienceLogEvents.addToLogger -= ScrapperRecordsLogEvents_addToLogger; Login.logger.addToLogger -= new EventHandler(ScrapperRecordsLogEvents_addToLogger); } catch { } finally { counter_ProcessComplete--; if (counter_ProcessComplete == 0) { if (btnStartAddExperience.InvokeRequired) { btnStartAddExperience.Invoke(new MethodInvoker(delegate { AddExperienceLogger("[ " + DateTime.Now + " ] => [ PROCESS COMPLETED ]"); AddExperienceLogger("----------------------------------------------------------------------------------------------------------------------------"); btnStartAddExperience.Cursor = Cursors.Default; })); } } } }