Example #1
0
        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("------------------------------------------------------------------------------------------------------------------------------------");
                }
            }
        }
Example #2
0
        public void PostGroupMsg(List<string> selectedItems, object parameter)
        {
            string postdata = string.Empty;
            string postUrl = string.Empty;
            string ResLogin = string.Empty;
            string csrfToken = string.Empty;
            string sourceAlias = string.Empty;

            string ReturnString = string.Empty;
            string PostGrpDiscussion = string.Empty;
            string PostGrpMoreDetails = string.Empty;
            string PostGrpKey = string.Empty;

            try
            {
                string MessageText = string.Empty;
                string PostedMessage = string.Empty;
                string pageSource = string.Empty;

                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();

                if (!Login.IsLoggedIn)
                {
                    Login.LoginHttpHelper(ref HttpHelper);
                }

                pageSource = HttpHelper.getHtmlfromUrl1(new Uri("http://www.linkedin.com/home?trk=hb_tab_home_top"));

                if (pageSource.Contains("csrfToken"))
                {
                    string pattern = @"\";
                    csrfToken = pageSource.Substring(pageSource.IndexOf("csrfToken"), 50);
                    string[] Arr = csrfToken.Split('&');
                    csrfToken = Arr[0];
                    csrfToken = csrfToken.Replace("csrfToken", "").Replace("\"", string.Empty).Replace("value", string.Empty).Replace("cs", string.Empty).Replace("id", string.Empty).Replace("=", string.Empty);
                    csrfToken = csrfToken.Replace(pattern, string.Empty.Trim());
                }

                if (pageSource.Contains("sourceAlias"))
                {
                    string pattern1 = @"\";
                    sourceAlias = pageSource.Substring(pageSource.IndexOf("sourceAlias"), 100);
                    string[] Arr = sourceAlias.Split('"');
                    sourceAlias = Arr[2];
                    sourceAlias = sourceAlias.Replace(pattern1, string.Empty.Trim());
                }

                //postUrl = "https://www.linkedin.com/uas/login-submit";
                //postdata = "session_key=" + Login.accountUser + "&session_password="******"&source_app=&trk=guest_home_login&session_redirect=&csrfToken=" + csrfToken + "&sourceAlias=" + sourceAlias;

                //ResLogin = HttpHelper.postFormData(new Uri(postUrl), postdata);

                try
                {
                    string PostGroupstatus;
                    string ResponseStatusMsg;
                    foreach (var Itegid in selectedItems)
                    {
                        lock (GroupStatus.Locked_GrpKey_Post)
                        {
                            if (GroupStatus.Que_GrpKey_Post.Count > 0)
                            {
                                try
                                {
                                    PostGrpKey = GroupStatus.Que_GrpKey_Post.Dequeue();
                                }
                                catch
                                {
                                }
                            }
                        }

                        lock (GroupStatus.Locked_GrpPostTitle_Post)
                        {
                            if (GroupStatus.Que_GrpPostTitle_Post.Count > 0)
                            {
                                try
                                {
                                    PostGrpDiscussion = GroupStatus.Que_GrpPostTitle_Post.Dequeue();
                                }
                                catch
                                {
                                }
                            }
                        }

                        lock (GroupStatus.Locked_GrpMoreDtl_Post)
                        {
                            if (GroupStatus.Que_GrpMoreDtl_Post.Count > 0)
                            {
                                try
                                {
                                    PostGrpMoreDetails = GroupStatus.Que_GrpMoreDtl_Post.Dequeue();
                                }
                                catch
                                {
                                }
                            }
                        }

                        string[] grpDisplay = Itegid.Split(':');
                        string GrpName = Itegid.ToString().Replace(",", ":").Replace("[", string.Empty).Replace("]", string.Empty).Trim();
                        string[] PostGid = GrpName.Split(':');
                        string Gid = string.Empty;

                        try
                        {
                            if (NumberHelper.ValidateNumber(PostGid[1].Trim()))
                            {
                                Gid = PostGid[1].Trim();
                            }
                            else if (NumberHelper.ValidateNumber(PostGid[2].Trim()))
                            {
                                Gid = PostGid[2].Trim();
                            }
                            else if (NumberHelper.ValidateNumber(PostGid[3].Trim()))
                            {
                                Gid = PostGid[3].Trim();
                            }
                            else if (NumberHelper.ValidateNumber(PostGid[4].Trim()))
                            {
                                Gid = PostGid[4].Trim();
                            }
                            else if (NumberHelper.ValidateNumber(PostGid[5].Trim()))
                            {
                                Gid = PostGid[5].Trim();
                            }
                            else if (NumberHelper.ValidateNumber(PostGid[6].Trim()))
                            {
                                Gid = PostGid[6].Trim();
                            }
                        }
                        catch
                        {
                        }

                        PostGroupstatus = "csrfToken=" + csrfToken + "&postTitle=" + PostGrpDiscussion + "&postText=" + PostGrpMoreDetails + "&pollChoice1-ANetPostForm=&pollChoice2-ANetPostForm=&pollChoice3-ANetPostForm=&pollChoice4-ANetPostForm=&pollChoice5-ANetPostForm=&pollEndDate-ANetPostForm=0&contentImageCount=0&contentImageIndex=-1&contentImage=&contentEntityID=&contentUrl=&contentTitle=&contentSummary=&contentImageIncluded=true&%23=&gid=" + Gid.Trim() + "&postItem=&ajax=true&tetherAccountID=&facebookTetherID=";

                        ResponseStatusMsg = HttpHelper.postFormData(new Uri("http://www.linkedin.com/groups"), PostGroupstatus);
                        Thread.Sleep(2000);

                        if (ResponseStatusMsg.Contains("SUCCESS"))
                        {
                            AddLoggerGroupStatus("[ " + DateTime.Now + " ] => [ Message Header Posted : " + PostGrpDiscussion + " Successfully on Group : " + grpDisplay[2] + " ]");
                            AddLoggerGroupStatus("[ " + DateTime.Now + " ] => [ Message More Details Posted : " + PostGrpMoreDetails + " Successfully on Group : " + grpDisplay[2] + " ]");

                            GlobusFileHelper.AppendStringToTextfileNewLine("Message Header Posted : " + PostGrpDiscussion + " Successfully on Group : " + grpDisplay[2], Globals.path_GroupUpdate);
                            GlobusFileHelper.AppendStringToTextfileNewLine("Message More Details Posted : " + PostGrpMoreDetails + " Successfully on Group : " + grpDisplay[2], Globals.path_GroupUpdate);
                        }
                        else if (ResponseStatusMsg.Contains("Your request to join is still pending"))
                        {
                            AddLoggerGroupStatus("[ " + DateTime.Now + " ] => [ Your membership is pending approval on a Group:" + grpDisplay[2] + " ]");
                            AddLoggerGroupStatus("[ " + DateTime.Now + " ] => [ Message Header: " + PostGrpDiscussion + " Not Posted on Group:" + grpDisplay[2] + " Because Your membership is pending for approval. ]");
                            AddLoggerGroupStatus("[ " + DateTime.Now + " ] => [ Message More Details: " + PostGrpMoreDetails + " Not Posted on Group:" + grpDisplay[2] + " Because Your membership is pending for approval. ]");

                            GlobusFileHelper.AppendStringToTextfileNewLine("Your membership is pending approval on a Group:" + grpDisplay[2], Globals.path_GroupUpdate);
                            GlobusFileHelper.AppendStringToTextfileNewLine("Message Header: " + PostGrpDiscussion + " Not Posted on Group:" + grpDisplay[2] + " Because Your membership is pending for approval. ", Globals.path_GroupUpdate);
                            GlobusFileHelper.AppendStringToTextfileNewLine("Message More Details: " + PostGrpMoreDetails + " Not Posted on Group:" + grpDisplay[2] + " Because Your membership is pending for approval. ", Globals.path_GroupUpdate);
                        }
                        else if (ResponseStatusMsg.Contains("Your post has been submitted for review"))
                        {
                            AddLoggerGroupStatus("[ " + DateTime.Now + " ] => [ Message Header Posted : " + PostGrpDiscussion + " Successfully on Group : " + grpDisplay[2] + " ]");
                            AddLoggerGroupStatus("[ " + DateTime.Now + " ] => [ Message More Details Posted : " + PostGrpMoreDetails + " Successfully on Group : " + grpDisplay[2] + " ]");
                            AddLoggerGroupStatus("[ " + DateTime.Now + " ] => [ Your post has been submitted for review ]");

                            GlobusFileHelper.AppendStringToTextfileNewLine("Message Header Posted : " + PostGrpDiscussion + " Successfully on Group : " + grpDisplay[2], Globals.path_GroupUpdate);
                            GlobusFileHelper.AppendStringToTextfileNewLine("Message More Details Posted : " + PostGrpMoreDetails + " Successfully on Group : " + grpDisplay[2], Globals.path_GroupUpdate);
                            GlobusFileHelper.AppendStringToTextfileNewLine("Your post has been submitted for review", Globals.path_GroupUpdate);
                        }
                        else if (ResponseStatusMsg.Contains("Error"))
                        {
                            AddLoggerCreateGroup("[ " + DateTime.Now + " ] => [ Error in Post ]");
                            GlobusFileHelper.AppendStringToTextfileNewLine("Error in Post", Globals.path_GroupUpdate);
                        }
                        else
                        {
                            AddLoggerCreateGroup("[ " + DateTime.Now + " ] => [ Message Not Posted ]");
                            GlobusFileHelper.AppendStringToTextfileNewLine("Message Not Posted", Globals.path_GroupUpdate);
                        }
                    }
                }
                catch (Exception ex)
                {
                    GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Group Update --> cmbGroupUser_SelectedIndexChanged() ---1--->>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs);
                    GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Group Update --> cmbGroupUser_SelectedIndexChanged() ---1--->>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinGetGroupMemberErrorLogs);
                    //AddLoggerGroupStatus("[ " + DateTime.Now + " ] => [ Error:" + ex.Message + "StackTrace --> >>>" + ex.StackTrace + " ]");
                }
                finally
                {
                    counter_GroupMemberSearch--;
                    int cnt = LinkedInManager.linkedInDictionary.Count - 1;
                    if (counter_GroupMemberSearch == cnt)
                    {
                        if (btnGroupUpdate.InvokeRequired)
                        {
                            btnGroupUpdate.Invoke(new MethodInvoker(delegate
                            {
                                //AddLoggerGroupStatus("Process Complete..");
                                btnGroupUpdate.Enabled = true;

                            }));
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Group Update --> cmbGroupUser_SelectedIndexChanged() ---2--->>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs);
                GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Group Update --> cmbGroupUser_SelectedIndexChanged() ---2--->>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinGetGroupMemberErrorLogs);
            }
        }
Example #3
0
        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;
                    }));
                }
            }
        }
        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 StartSendInvitationMultyThread(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;

                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)
                {
                    Login.LoginHttpHelper(ref HttpHelper);
                }

                if (Login.IsLoggedIn)
                {
                    obj_ClsInviteMemberThroughProfileURL.StartSendInvitations(ref HttpHelper);
                }
                else
                {
                    AddInviteMemberThroughProfUrlLogger("[ " + DateTime.Now + " ] => [ Couldn't Login With Account " + item.Key + " ]");
                }

                // 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
            {
                BtnSendInvitation.Invoke(new MethodInvoker(delegate
                    {
                        BtnSendInvitation.Cursor = Cursors.Default;
                    }));
            }
        }
        //****************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;
                        }));
                    }
                }
            }
        }
Example #8
0
        public void EndorsingPerDay(object parameter)
        {
            try
            {

                lstEndorsementThread.Add(Thread.CurrentThread);
                lstEndorsementThread = lstEndorsementThread.Distinct().ToList();
                Thread.CurrentThread.IsBackground = true;

                int NoOfEndorsementPerDay = 10;
                int Counter = 0;
                int MinDelay = 20;
                int MaxDelay = 25;

                List<string> LstFriendId = new List<string>();

                //NoOfEndorsementPerDay = int.Parse(txtNoOfEndorsementPerDay.Text);
                Array paramsArray = new object[1];
                paramsArray = (Array)parameter;

                NoOfEndorsementPerDay = (int)paramsArray.GetValue(1);
                EndorsePeople.no_of_Skils = (int)paramsArray.GetValue(2);
                MinDelay = (int)paramsArray.GetValue(3);
                MaxDelay = (int)paramsArray.GetValue(4);

                KeyValuePair<string, LinkedInMaster> item = (KeyValuePair<string, LinkedInMaster>)paramsArray.GetValue(0);
                AddLoggerEndorsePeople("[ " + DateTime.Now + " ] => [ Logging In With " + item.Key + " ]");

                if (!item.Value.IsLoggedIn)
                {
                    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;
                    Login.LoginHttpHelper(ref HttpHelper);

                    if (Login.IsLoggedIn)
                    {
                        AddLoggerEndorsePeople("[ " + DateTime.Now + " ] => [ Logged In With " + item.Key + " ]");
                    }
                    else
                    {
                        AddLoggerEndorsePeople("[ " + DateTime.Now + " ] => [ Not Logged In With " + item.Key + " ]");
                        return;
                    }

                    if (Login.IsLoggedIn)
                    {
                        //GroupStatus dataScrape = new GroupStatus();
                        string query = "Select * From tb_endorsement WHERE  (Username = '******')";
                        DataSet ds = DataBaseHandler.SelectQuery(query, "tb_endorsement");
                        DataTable dt = ds.Tables["tb_endorsement"];
                        string Username = string.Empty;
                        if (dt.Rows.Count > 0)
                        {
                            Username = dt.Rows[0]["Username"].ToString();
                        }

                        if (Username != item.Key)
                        {
                            AddLoggerEndorsePeople("[ " + DateTime.Now + " ] => [ Scraping 1st Connection from Account : " + item.Key + " ]");
                            GroupStatus MemberScrape = new GroupStatus();

                            GroupStatus.moduleLog = "endorsecamp";
                            Dictionary<string, string> Result = MemberScrape.PostAddMembers(ref HttpHelper, Login.accountUser);
                            AddLoggerEndorsePeople("[ " + DateTime.Now + " ] => [ Scraping process completed from Account : " + item.Key + " ]");
                        }

                        AddLoggerEndorsePeople("[ " + DateTime.Now + " ] => [ Starting Endorsing People ]");

                        string SelectQuery = "select * from tb_endorsement where Username = '******' and Status=0";
                        DataSet dst = DataBaseHandler.SelectQuery(SelectQuery, "tb_endorsement");
                        DataTable dt1 = dst.Tables["tb_endorsement"];

                        foreach (DataRow dr in dt1.Rows)
                        {
                            if (Counter <= NoOfEndorsementPerDay)
                            {
                                string FriendId = dr["FriendId"].ToString();

                                LstFriendId.Add(FriendId);
                                Counter++;
                            }
                            else
                            {
                                break;
                            }
                        }
                    }

                    EndorsePeople EnorsePeople = new EndorsePeople();
                    EnorsePeople.Username = item.Key;

                    foreach (string _FriendId in LstFriendId)
                    {
                        int delay = RandomNumberGenerator.GenerateRandom(MinDelay, MaxDelay);

                        try
                        {
                            EnorsePeople.EndorsingPeople(ref HttpHelper, _FriendId);

                            string strQuery = "UPDATE tb_endorsement SET Status='" + "1" + "' WHERE Status='0' AND FriendId ='" + _FriendId + "' AND Username ='******' ";
                            DataBaseHandler.UpdateQuery(strQuery, "tb_endorsement");

                            AddLoggerEndorsePeople("[ " + DateTime.Now + " ] => [ Delay for : " + delay + " Seconds ]");
                            Thread.Sleep(delay * 1000);
                        }
                        catch { }
                    }
                }
            }
            catch (Exception ex)
            {
                GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error -->EndorsingPeople() >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs);
                GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> EndorsingPeople() >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.path_EndorsePeople);
            }
            finally
            {
                Count_Endorse--;

                if (Count_Endorse == 0)
                {

                    btnstartEndorse.Invoke(new MethodInvoker(delegate
                    {
                        AddLoggerEndorsePeople("[ " + DateTime.Now + " ] => [ PROCESS COMPLETED ]");
                        AddLoggerEndorsePeople("-------------------------------------------------------------------------------------------------------------------------------");
                        btnStartCampaingEndorsement.Cursor = Cursors.Default;
                    }));
                }
            }
        }
Example #9
0
        public void StartCrawlSpecificGroupUserPages(object parameter)
        {
            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();

            if (!Login.IsLoggedIn)
            {
                Login.LoginHttpHelper(ref HttpHelper);
            }

            try
            {
                if (Login.IsLoggedIn)
                {
                    GroupStatus dataScrape = new GroupStatus();
                    GroupPages = dataScrape.PageNoSpecGroup(ref HttpHelper, SpeGroupIdFPages);

                    if (txtPages.InvokeRequired)
                    {
                        new Thread(() =>
                        {
                            txtPages.Invoke(new MethodInvoker(delegate
                            {
                                txtPages.Text = GroupPages;
                            }));
                        }).Start();
                    }

                    //AddLoggerGroupMemMessage("Loggin In With Email : " + item.Value._Username);
                    AddLoggerLinkedingrp("[ " + DateTime.Now + " ] => [ Loggin In With Email : " + item.Value._Username + " ]");
                }
            }
            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 (cmbAllUser.InvokeRequired)
                    {
                        cmbAllUser.Invoke(new MethodInvoker(delegate
                        {
                            AddLoggerLinkedingrp("[ " + DateTime.Now + " ] => [ PROCESS COMPLETED ]");
                            AddLoggerLinkedingrp("--------------------------------------------------------------------------------------------------------------------------");
                            cmbAllUser.Enabled = true;
                            cmbMemberGroup.Cursor = Cursors.Default;

                        }));
                    }
                }
            }
        }
Example #10
0
        public void StartCrawlSpecificGroupUser(object parameter)
        {
            try
            {
                try
                {
                    if (IsStop)
                    {
                        return;
                    }

                    if (!IsStop)
                    {
                        lstGroupMessageThread.Add(Thread.CurrentThread);
                        lstGroupMessageThread.Distinct().ToList();
                        Thread.CurrentThread.IsBackground = true;
                    }
                }
                catch (Exception ex)
                {
                    Console.WriteLine("Error >>> " + ex.StackTrace);
                }

                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();

                if (!Login.IsLoggedIn)
                {
                    Login.LoginHttpHelper(ref HttpHelper);
                }

                try
                {
                    if (Login.IsLoggedIn)
                    {
                        string selecteduser = string.Empty;
                        GroupStatus dataScrape = new GroupStatus();
                        dataScrape.loggerGroupMem.addToLogger += new EventHandler(GroupMemMessage_addToLogger);

                        cmbAllUser.Invoke(new MethodInvoker(delegate
                        {
                            selecteduser = cmbAllUser.SelectedItem.ToString();

                        }));

                        if (Login.accountUser == selecteduser)
                        {
                            //Login.LoginHttpHelper(ref HttpHelper);
                            if (GroupStatus.withExcelInput == true)
                            {
                                GroupMemData = dataScrape.AddSpecificGroupUserWithExcelInput(ref HttpHelper, Login.accountUser, SpeGroupId);
                            }
                            else
                            {
                                //GroupStatus.GroupMemUrl
                                if (chkAllAcounts.Checked)
                                {
                                    foreach (var SpeGroupId1 in GroupStatus.GroupMemUrl)
                                    {
                                        Dictionary<string, string> GroupMem = dataScrape.AddSpecificGroupUser(ref HttpHelper, Login.accountUser, SpeGroupId1);
                                        foreach (var GroupMem_item in GroupMem)
                                        {
                                            try
                                            {
                                                string GrpMemberKey = GroupMem_item.Key;
                                                string GrpMemberValue = GroupMem_item.Value;

                                                GroupMemData.Add(GrpMemberKey, GrpMemberValue);

                                            }
                                            catch { };

                                        }

                                    }
                                }
                                else
                                {
                                    //SpeGroupId = GroupStatus.GroupMemUrl[0];
                                    // GroupMemData = dataScrape.AddSpecificGroupUser(ref HttpHelper, Login.accountUser, SpeGroupId);
                                    GroupMemData = dataScrape.AddSpecificGroupUser(ref HttpHelper, Login.accountUser, Specgroupdetails);
                                }
                            }

                            if (GroupMemData.Count == 0)
                            {
                                string[] SelUser = selectedSpeUser.Split(':');
                                AddLoggerLinkedingrp("[ " + DateTime.Now + " ] => [ Group : " + SelUser[1] + " Has No Other Member than You ]");
                                return;
                            }
                            GrpMemNameWithGid.Add(Login.accountUser, GroupMemData);
                        }

                        if (chkListGroupMembers.InvokeRequired)
                        {
                            new Thread(() =>
                            {
                                chkListGroupMembers.Invoke(new MethodInvoker(delegate
                                {
                                    foreach (var itemM in GroupMemData)
                                    {
                                        chkListGroupMembers.Items.Add(itemM.Value);
                                    }
                                }));
                            }).Start();
                        }
                        AddLoggerLinkedingrp("[ " + DateTime.Now + " ] => [ Added Group Members of : " + item.Value._Username + " ]");
                    }
                    else
                    {
                        AddLoggerLinkedingrp("[ " + 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);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error >>> " + ex.StackTrace);
            }
        }
Example #11
0
        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);

            try
            {
                {
                    Queue<string> que_SearchKeywords = new Queue<string>();
                    foreach (string itemKeyword in _lstConnectionSearchKeyword)
                    {
                        que_SearchKeywords.Enqueue(itemKeyword);
                    }

                    ManageConnections.ConnectUsing_Search ConnectUsing_Search = new ConnectUsing_Search(item.Value._Username, item.Value._Password, item.Value._ProxyAddress, item.Value._ProxyPort, item.Value._ProxyUsername, item.Value._ProxyPassword, que_SearchKeywords);
                    ManageConnections.ConnectUsing_Search.ConnectSearchUsingkeyword(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 (btnSearchConnection.InvokeRequired)
                    {
                        btnSearchConnection.Invoke(new MethodInvoker(delegate
                        {
                            AddLoggerManageConnection("[ " + DateTime.Now + " ] => [ PROCESS COMPLETED ]");
                            AddLoggerManageConnection("---------------------------------------------------------------------------------------------------------------------------");
                            btnSearchConnection.Cursor = Cursors.Default;

                        }));
                    }
                }
            }
            // }

            // }
            //else
            //{
            //    AddLoggerManageConnection("Please Enter Keywords!");
            //}
            //AddLoggerManageConnection("Process Completed ");
        }
Example #12
0
        public void SendInviteUsingEmails(object Parameter)
        {
            string Account = string.Empty;
            try
            {
                try
                {
                    if (IsStop)
                    {
                        return;
                    }

                    if (!IsStop)
                    {
                        lstSearchconnectionThread.Add(Thread.CurrentThread);
                        lstSearchconnectionThread.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);
                //  List<string> _lstInviteEmailConnection = (List<string>)paramsArray.GetValue(1);

                lstInviteEmailConnection_temp = (List<string>)paramsArray.GetValue(1);
                int SearchMinDelay = Convert.ToInt32(paramsArray.GetValue(2));
                int SearchMaxDelay = Convert.ToInt32(paramsArray.GetValue(3));
                GlobusHttpHelper HttpHelper = new GlobusHttpHelper();
                LinkedinLogin Login = new LinkedinLogin();

                LinkedInMaster LinkedIn_Master = item.Value;
                string linkedInKey = item.Key;
                Account = item.Key;

                Queue<string> que_SearchEmail = new Queue<string>();
                foreach (string itemKeyword in lstInviteEmailConnection_temp)
                {
                    que_SearchEmail.Enqueue(itemKeyword);
                }

                ManageConnections.InvitationEmails invitationEmails = new InvitationEmails(item.Value._Username, item.Value._Password, item.Value._ProxyAddress, item.Value._ProxyPort, item.Value._ProxyUsername, item.Value._ProxyPassword, que_SearchEmail, lstInviteEmailConnection_temp);

                ManageConnections.InvitationEmails._lstInviteEmail = lstInviteEmailConnection_temp;

                ManageConnections.InvitationEmails Email = new ManageConnections.InvitationEmails();

                if (!string.IsNullOrEmpty(txtSearchMindelay.Text) && NumberHelper.ValidateNumber(txtSearchMindelay.Text))
                {
                    Email.MinimumDelay = Convert.ToInt32(txtSearchMindelay.Text);
                }
                if (!string.IsNullOrEmpty(txtSearchMaxDelay.Text) && NumberHelper.ValidateNumber(txtSearchMaxDelay.Text))
                {
                    Email.MaximumDelay = Convert.ToInt32(txtSearchMaxDelay.Text);
                }

                if (chkUniqueEmailConnection.Checked == true)
                {
                    ManageConnections.InvitationEmails.UniqueEmailStatus = "True";
                }

                ManageConnections.InvitationEmails.InviteEmailConnect(ref invitationEmails, SearchCriteria.NumberOfRequestPerEmail, Email.MaximumDelay, Email.MinimumDelay);

                //invitationEmails.InviteConnectionLogEvents.addToLogger -= new EventHandler(InviteConnectionLogEvents_addToLogger);
            }
            catch (Exception ex)
            {
                GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Add Connection --> SendInviteUsingEmails() >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs);
                GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Add Connection --> SendInviteUsingEmails() >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinAddConnectionErrorLogs);
            }
            finally
            {
                AddLoggerManageConnection("[ " + DateTime.Now + " ] => [ Finished Email Invites For Account :" + Account + " ]");

                counter_EmailInvite--;
                if (counter_EmailInvite == 0)
                {
                    InvitationEmails.listItemTempForInvitation.Clear();

                    if (btnSendEmailInvite.InvokeRequired)
                    {
                        btnSendEmailInvite.Invoke(new MethodInvoker(delegate
                        {
                            AddLoggerManageConnection("[ " + DateTime.Now + " ] => [ PROCESS COMPLETED ]");
                            AddLoggerManageConnection("--------------------------------------------------------------------------------------------------------------------------");
                            btnSendEmailInvite.Cursor = Cursors.Default;

                        }));
                    }
                }
            }
        }
Example #13
0
        public void PostMessageGroupMembers(object parameter)
        {
            try
            {
                try
                {
                    if (IsStop)
                    {
                        return;
                    }

                    if (!IsStop)
                    {
                        lstGroupMessageThread.Add(Thread.CurrentThread);
                        lstGroupMessageThread.Distinct().ToList();
                        Thread.CurrentThread.IsBackground = true;
                    }
                }
                catch (Exception ex)
                {
                    Console.WriteLine("Error >>> " + ex.StackTrace);
                }

                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;

                AddLoggerGroupMemMessage("[ " + DateTime.Now + " ] => [ Sending Message From Account : " + item.Key + " ]");
                string selectedusername = item.Key;
                try
                {
                    if (!Login.IsLoggedIn)
                    {
                        Login.LoginHttpHelper(ref HttpHelper);
                    }
                }
                catch (Exception ex)
                {
                    GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Compose Message --> PostMessageBulk() -->  Login Process >>>>" + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs);
                    GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Compose Message --> PostMessageBulk() -->  Login Process >>>>" + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinComposeMessageErrorLogs);
                }

                try
                {
                    if (Login.IsLoggedIn)
                    {
                        AddLoggerGroupMemMessage("[ " + DateTime.Now + " ] => [ Getting Contacts to Send Message ]");
                        List<string> SelectedItem = new List<string>();
                        string Userid = string.Empty;
                        if (cmbMemberGroup.InvokeRequired)
                        {
                            cmbMemberGroup.Invoke(new MethodInvoker(delegate
                            {
                                if (GroupStatus.selectAllGroup == false)
                                {
                                    Userid = cmbMemberGroup.SelectedItem.ToString();
                                }
                            }));
                        }

                        GroupStatus MemberScrape = new GroupStatus();
                        string FromEmailId = MemberScrape.FromEmailCodeMsgGroupMem(ref HttpHelper, SpeGroupId);
                        string FromEmailName = MemberScrape.FromName(ref HttpHelper);

                        FromemailId = FromEmailId;
                        FromEmailNam = FromEmailName;

                        Dictionary<string, string> SelectedGroupMem = new Dictionary<string, string>();
                        foreach (KeyValuePair<string, Dictionary<string, string>> contacts in GrpMemNameWithGid)
                        {
                            if (contacts.Key.Trim() == item.Key.Trim())
                            {
                                foreach (KeyValuePair<string, string> Details in contacts.Value)
                                {
                                    foreach (string itemChecked in chkListGroupMembers.CheckedItems)
                                    {
                                        if (itemChecked == Details.Value)
                                        {
                                            try
                                            {
                                                string id = Details.Key;
                                                SelectedGroupMem.Add(id, Details.Value);
                                            }
                                            catch
                                            {
                                            }
                                        }
                                    }
                                }
                            }
                        }

                        string msgSub = txtSubject.Text;
                        string msgBody = txtBody.Text;

                        if (chkUseSpintax_GroupMessage.Checked)
                        {
                            try
                            {
                                msgSub = GrpMemSubjectlist[RandomNumberGenerator.GenerateRandom(0, GrpMemSubjectlist.Count - 1)];
                                msgBody = GrpMemMessagelist[RandomNumberGenerator.GenerateRandom(0, GrpMemMessagelist.Count - 1)];
                            }
                            catch
                            {
                            }
                        }

                        int minDelay = 20;
                        int maxDelay = 25;

                        if (!string.IsNullOrEmpty(txtMsgGroupMemMinDelay.Text) && NumberHelper.ValidateNumber(txtMsgGroupMemMinDelay.Text))
                        {
                            minDelay = Convert.ToInt32(txtMsgGroupMemMinDelay.Text);
                        }
                        if (!string.IsNullOrEmpty(txtMsgGroupMemMaxDelay.Text) && NumberHelper.ValidateNumber(txtMsgGroupMemMaxDelay.Text))
                        {
                            maxDelay = Convert.ToInt32(txtMsgGroupMemMaxDelay.Text);
                        }

                        try
                        {
                            Groups.MessageGroupMember obj_MessageGroupMember = new Groups.MessageGroupMember();
                            obj_MessageGroupMember.logger.addToLogger += new EventHandler(GroupMemMessage_addToLogger);
                            obj_MessageGroupMember.PostFinalMsgGroupMember_1By1(ref HttpHelper, SelectedGroupMem, GrpMemSubjectlist, GrpMemMessagelist, msgSub, msgBody, selectedusername, FromemailId, FromEmailNam, _SelectedGroupName_MessageGroupMember, SpeGroupId, mesg_with_tag, msg_spintaxt, minDelay, maxDelay, preventMsgSameGroup, preventMsgWithoutGroup, preventMsgGlobal);
                            obj_MessageGroupMember.logger.addToLogger -= new EventHandler(GroupMemMessage_addToLogger);
                        }
                        catch
                        {
                        }
                        finally
                        {
                            if (btnGroupMessage.InvokeRequired)
                            {
                                btnGroupMessage.Invoke(new MethodInvoker(delegate
                                {
                                    AddLoggerGroupMemMessage("[ " + DateTime.Now + " ] => [ PROCESS COMPLETED ]");
                                    AddLoggerGroupMemMessage("----------------------------------------------------------------------------------------------------------------------------------------");
                                    btnGroupMessage.Cursor = Cursors.Default;
                                }));
                            }
                        }
                    }
                    else if (!Login.IsLoggedIn)
                    {
                    }
                }
                catch (Exception ex)
                {
                    GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Compose Message --> PostMessageBulk() -->  PostFinalMsg >>>>" + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs);
                    GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Compose Message --> PostMessageBulk() -->  PostFinalMsg >>>>" + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinComposeMessageErrorLogs);
                }
            }
            catch (Exception ex)
            {
                GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Compose Message --> PostMessageBulk() --> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs);
                GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Compose Message --> PostMessageBulk() --> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinComposeMessageErrorLogs);
            }
        }
Example #14
0
        public void PostMessageBulk(object parameter)
        {
            try
            {
                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;

                ComposeMessage.ComposeMessage obj_ComposeMessage = new ComposeMessage.ComposeMessage();
                obj_ComposeMessage.logger.addToLogger += new EventHandler(ComposeMessage_addToLogger);

                AddLoggerComposeMessage("[ " + DateTime.Now + " ] => [ Sending Message From Account : " + item.Key + " ]");
                string UserEmail = string.Empty;
                UserEmail = item.Key;
                try
                {
                    if (!Login.IsLoggedIn)
                    {
                        Login.LoginHttpHelper(ref HttpHelper);
                    }
                }
                catch (Exception ex)
                {
                    GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Compose Message --> PostMessageBulk() -->  Login Process >>>>" + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs);
                    GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Compose Message --> PostMessageBulk() -->  Login Process >>>>" + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinComposeMessageErrorLogs);
                }

                try
                {
                    if (Login.IsLoggedIn)
                    {
                        AddLoggerComposeMessage("[ " + DateTime.Now + " ] => [ Logged In With Email : " + item.Value._Username + " ]");
                        AddLoggerComposeMessage("[ " + DateTime.Now + " ] => [ Getting Contacts to Send Message ]");

                        List<string> SelectedItem = new List<string>();
                        string Userid = string.Empty;
                        if (cmbMsgFrom.InvokeRequired)
                        {
                            cmbMsgFrom.Invoke(new MethodInvoker(delegate
                            {
                                Userid = cmbMsgFrom.SelectedItem.ToString();
                            }));
                        }

                        GroupStatus MemberScrape = new GroupStatus();
                        //string FromEmailId = MemberScrape.FromEmailCode(ref HttpHelper, SpeGroupId);
                        string FromEmailId = MemberScrape.FromEmailCodeComposeMsg(ref HttpHelper, Userid);
                        string FromEmailName = MemberScrape.FromName(ref HttpHelper);

                        Dictionary<string, string> SelectedContacts = new Dictionary<string, string>();

                        foreach (KeyValuePair<string, Dictionary<string, string>> contacts in MessageContacts)
                        {
                            if (contacts.Key == item.Key)
                            {
                                foreach (KeyValuePair<string, string> Details in contacts.Value)
                                {
                                    foreach (string itemChecked in chkMessageTo.CheckedItems)
                                    {

                                        if (itemChecked == Details.Value)
                                        {
                                            try
                                            {
                                                string id = Regex.Split(Details.Key, ":")[1];
                                                SelectedContacts.Add(id, Details.Value);
                                            }
                                            catch
                                            {

                                                SelectedContacts.Add(Details.Key, Details.Value);
                                            }
                                        }
                                        if (!(itemChecked == Details.Value))
                                        {
                                            try
                                            {
                                                string Value = Details.Value.Replace(",", string.Empty);
                                                if (itemChecked == Value)
                                                {
                                                    try
                                                    {
                                                        string id = Regex.Split(Details.Key, ":")[1];
                                                        SelectedContacts.Add(id, Details.Value);
                                                    }
                                                    catch
                                                    {
                                                    }
                                                }
                                            }
                                            catch
                                            { }
                                        }
                                    }
                                }
                            }
                        }

                        string msgBodyCompose = txtMsgBody.Text;
                        string msgSubCompose = txtMsgSubject.Text;
                        if (chkSpinTaxComposeMsg.Checked)
                        {
                            try
                            {
                                //msgBodyCompose = MessagelistCompose[RandomNumberGenerator.GenerateRandom(0, MessagelistCompose.Count - 1)];
                                msgBodyCompose = GlobusSpinHelper.spinLargeText(new Random(), txtMsgBody.Text);
                                msgBodycomposePass = txtMsgBody.Text;
                                msgSubCompose = subjectlistCompose[RandomNumberGenerator.GenerateRandom(0, subjectlistCompose.Count - 1)];
                            }
                            catch
                            {
                            }
                        }

                        // Calling PostFinalMsg(ref HttpHelper, SelectedContacts, txtMsgSubject.Text, msgBodyCompose.ToString(),UserEmail); from Compose Messge Module
                        int minDelay = 20;
                        int maxDelay = 25;

                        if (!string.IsNullOrEmpty(txtComposeMsgMinDelay.Text) && NumberHelper.ValidateNumber(txtComposeMsgMinDelay.Text))
                        {
                            minDelay = Convert.ToInt32(txtComposeMsgMinDelay.Text);
                        }
                        if (!string.IsNullOrEmpty(txtComposeMsgMaxDelay.Text) && NumberHelper.ValidateNumber(txtComposeMsgMaxDelay.Text))
                        {
                            maxDelay = Convert.ToInt32(txtComposeMsgMaxDelay.Text);
                        }

                        if (RdbMessagingWithTag_ComposeMessage.Checked)
                        {
                            // obj_ComposeMessage.PostFinalMsg_1By1(ref HttpHelper, SelectedContacts, txtMsgSubject.Text, msgBodyCompose.ToString(), UserEmail, FromemailId, FromEmailNam, minDelay, maxDelay);
                            obj_ComposeMessage.PostFinalMsg_1By1(ref HttpHelper, SelectedContacts, subjectlistCompose, msgBodycomposePass, msgSubCompose.ToString(), msgBodyCompose.ToString(), UserEmail, FromEmailId, FromEmailName, msg_spintaxt, minDelay, maxDelay, preventMsgSameUser, preventMsgGlobalUser);
                        }
                        else
                        {
                            //obj_ComposeMessage.PostFinalMsg(ref HttpHelper, SelectedContacts, txtMsgSubject.Text, msgBodyCompose.ToString(), UserEmail, FromemailId, FromEmailNam, minDelay, maxDelay);
                            obj_ComposeMessage.PostFinalMsg(ref HttpHelper, SelectedContacts, msgBodycomposePass, subjectlistCompose, msgSubCompose.ToString(), msgBodyCompose.ToString(), UserEmail, FromEmailId, FromEmailName, msg_spintaxt, minDelay, maxDelay, preventMsgSameUser, preventMsgGlobalUser);

                            int counter = ComposeMessage.ComposeMessage.SlectedContacts1.Count();

                            if (counter > 0)
                            {
                                do
                                {
                                    // obj_ComposeMessage.PostFinalMsg(ref HttpHelper, ComposeMessage.ComposeMessage.SlectedContacts1, txtMsgSubject.Text, msgBodyCompose.ToString(), UserEmail, FromemailId, FromEmailNam, minDelay, maxDelay);
                                    obj_ComposeMessage.PostFinalMsg(ref HttpHelper, ComposeMessage.ComposeMessage.SlectedContacts1, msgBodycomposePass, subjectlistCompose, msgSubCompose.ToString(), msgBodyCompose.ToString(), UserEmail, FromEmailId, FromEmailNam, msg_spintaxt, minDelay, maxDelay, preventMsgSameUser, preventMsgGlobalUser);
                                    counter = ComposeMessage.ComposeMessage.SlectedContacts1.Count();

                                } while (counter > 0);
                            }
                        }

                        obj_ComposeMessage.logger.addToLogger -= new EventHandler(ComposeMessage_addToLogger);
                        //PostFinalMsg(ref HttpHelper, SelectedContacts, txtMsgSubject.Text, msgBodyCompose.ToString(),UserEmail);
                    }
                    else if (!Login.IsLoggedIn)
                    {
                        AddLoggerComposeMessage("[ " + DateTime.Now + " ] => [ Couldn't Login With Email : " + item.Value._Username + "]");
                    }
                }
                catch (Exception ex)
                {
                    GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Compose Message --> PostMessageBulk() -->  PostFinalMsg >>>>" + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs);
                    GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Compose Message --> PostMessageBulk() -->  PostFinalMsg >>>>" + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinComposeMessageErrorLogs);
                }

                #region old code

                //AddLoggerComposeMessage("Compose Message From: " + Userid);
                //string Mposted = MessagePosted.Split(':')[0];
                //if (Mposted.Contains("Your message was successfully sent."))
                //{
                //    AddLoggerComposeMessage("Message Posted To : All Selected Accounts");
                //}
                //else if (MessagePosted.Contains("Error"))
                //{
                //    AddLoggerComposeMessage("Error in Post");
                //}
                //else
                //{
                //    AddLoggerComposeMessage("Message Not Posted");
                //}

                #endregion

            }
            catch (Exception ex)
            {
                GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Compose Message --> PostMessageBulk() --> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs);
                GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Compose Message --> PostMessageBulk() --> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinComposeMessageErrorLogs);
            }
            finally
            {
                if (chkSelectAll.Checked)
                {
                    NoOfAccountsLoggedin--;
                    if (NoOfAccountsLoggedin == 0)
                    {
                        if (btnSendMsg.InvokeRequired)
                        {
                            btnSendMsg.Invoke(new MethodInvoker(delegate
                            {
                                AddLoggerComposeMessage("[ " + DateTime.Now + " ] => [ PROCESS COMPLETED ]");
                                AddLoggerComposeMessage("-------------------------------------------------------------------------------------------------------------------------------");
                                btnSendMsg.Cursor = Cursors.Default;
                            }));
                        }
                    }
                }
                else
                {
                    if (btnSendMsg.InvokeRequired)
                    {
                        btnSendMsg.Invoke(new MethodInvoker(delegate
                        {
                            AddLoggerComposeMessage("[ " + DateTime.Now + " ] => [ PROCESS COMPLETED ]");
                            AddLoggerComposeMessage("-----------------------------------------------------------------------------------------------------------------------------------");
                            btnSendMsg.Cursor = Cursors.Default;
                        }));
                    }
                }
            }
        }
Example #15
0
        public void PostGroupMsgUpdate(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);
                }

                List<string> GetCheckedItems = new List<string>();

                if (chkGroupCollection.InvokeRequired)
                {
                    chkGroupCollection.Invoke(new MethodInvoker(delegate
                    {
                        foreach (string Userid in chkGroupCollection.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);
                }

                if (chkSameMessageForAllGroup.Checked)
                {

                    obj_GroupUpdate.PostGroupSameMessageForAllGroup(ref HttpHelper, SelectedItem, new object[] { item, user }, minDelay, maxDelay);
                    return;
                }

                if (!chkAttachLinkGroupUpdate.Checked == true)
                {
                    obj_GroupUpdate.PostGroupMsg(ref HttpHelper, SelectedItem, new object[] { item, user }, minDelay, maxDelay);

                }
                else
                {
                    obj_GroupUpdate.PostAttachLinkGroupUpdate(ref HttpHelper, SelectedItem, new object[] { item, user }, minDelay, maxDelay);
                }

                Thread.Sleep(2000);
            }
            catch (Exception ex)
            {
                GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Group Update --> PostGroupMsgUpdate() >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs);
                GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Group Update --> PostGroupMsgUpdate() >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinGetGroupMemberErrorLogs);
            }
            finally
            {
                counter_GroupMemberSearch--;
                int cnt = LinkedInManager.linkedInDictionary.Count - 1;
                if (counter_GroupMemberSearch == cnt)
                {
                    if (btnGroupUpdate.InvokeRequired)
                    {
                        btnGroupUpdate.Invoke(new MethodInvoker(delegate
                        {
                            AddLoggerGroupStatus("[ " + DateTime.Now + " ] => [ PROCESS COMPLETED ]");
                            AddLoggerGroupStatus("----------------------------------------------------------------------------------------------------------------------------");
                            btnGroupUpdate.Enabled = true;
                            btnGroupUpdate.Cursor = Cursors.Default;

                        }));
                    }
                }

            }
        }
Example #16
0
        public void EndorsingPeople(object parameter)
        {
            try
            {
                int MinDelay = 20;
                int MaxDelay = 25;

                lstEndorsementThread.Add(Thread.CurrentThread);
                lstEndorsementThread = lstEndorsementThread.Distinct().ToList();
                Thread.CurrentThread.IsBackground = true;

                Array paramsArray = new object[1];
                paramsArray = (Array)parameter;
                KeyValuePair<string, LinkedInMaster> item = (KeyValuePair<string, LinkedInMaster>)paramsArray.GetValue(0);
                MinDelay = (int)paramsArray.GetValue(1);
                MaxDelay = (int)paramsArray.GetValue(2);

                //AddLoggerEndorsePeople("[ " + DateTime.Now + " ] => [ Logging In With " + item.Key + " ]");

                try
                {
                    if (!item.Value.IsLoggedIn)
                    {
                        GlobusHttpHelper HttpHelper = new GlobusHttpHelper();

                        LinkedinLogin Login = new LinkedinLogin();
                        Login.accountUser = item.Key;
                        try
                        {
                            CheckDuplicate.Add(Login.accountUser, Login.accountUser);
                        }
                        catch (Exception)
                        {

                            return;
                        }

                        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.LoginHttpHelper(ref HttpHelper);

                        if (Login.IsLoggedIn)
                        {
                            try
                            {
                                Globals.tempDict.Add(item.Key, "");
                                AddLoggerEndorsePeople("[ " + DateTime.Now + " ] => [ Logged In With " + item.Key + " ]");
                                AddLoggerEndorsePeople("[ " + DateTime.Now + " ] => [ Starting Endorsing People ]");
                            }
                            catch
                            { }
                        }
                        else
                        {
                            AddLoggerEndorsePeople("[ " + DateTime.Now + " ] => [ Not Logged In With " + item.Key + " ]");
                            return;
                        }

                        EndorsePeople EnorsePeople = new EndorsePeople();
                        EnorsePeople.Username = item.Key;

                        counter1 = EndorsePeople.Endorse_excelData.Count;

                        foreach (string[] itemArr in EndorsePeople.Endorse_excelData)
                        {
                            int delay = RandomNumberGenerator.GenerateRandom(MinDelay, MaxDelay);

                            EnorsePeople.EndorsingPeople(ref HttpHelper, itemArr[1]);

                            AddLoggerEndorsePeople("[ " + DateTime.Now + " ] => [ Delay for : " + delay + " Seconds ]");
                            Thread.Sleep(delay * 1000);
                        }
                    }
                }
                catch
                {
                    //repeated ID
                }
            }
            catch (Exception ex)
            {
                GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error -->EndorsingPeople() >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs);
                GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> EndorsingPeople() >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.path_EndorsePeople);
            }
            finally
            {
                counter1--;

                if (counter1 == 0)
                {
                    btnstartEndorse.Invoke(new MethodInvoker(delegate
                    {
                        AddLoggerEndorsePeople("[ " + DateTime.Now + " ] => [ PROCESS COMPLETED ]");
                        AddLoggerEndorsePeople("----------------------------------------------------------------------------------------------------------------------------------------");
                        btnstartEndorse.Cursor = Cursors.Default;
                    }));
                }
            }
        }
Example #17
0
        public void StartScrapingJobDetails(object Parameter)
        {
            try
            {
                try
                {
                    if (IsStop)
                    {
                        return;
                    }

                    if (!IsStop)
                    {
                        try
                        {
                            lstInBoardProGetDataThraed.Add(Thread.CurrentThread);
                            lstInBoardProGetDataThraed = lstInBoardProGetDataThraed.Distinct().ToList();
                            Thread.CurrentThread.IsBackground = true;
                        }
                        catch { }
                    }
                }
                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;
                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(ShareLogEvents_addToLogger);
                obj_StatusUpdate.logger.addToLogger += new EventHandler(ShareLogEvents_addToLogger);

                AddLoggerShare("[ " + DateTime.Now + " ] => [ Logging with Account: " + Login.accountUser + " ]");
                if (!Login.IsLoggedIn)
                {
                    Login.LoginHttpHelper(ref HttpHelper);
                }

                if (!Login.IsLoggedIn)
                {
                    AddLoggerShare("[ " + DateTime.Now + " ] => [ Couldn't Login With Username >>> " + Login.accountUser + " ]");
                    return;
                }
                AddLoggerShare("[ " + DateTime.Now + " ] => [ Logged with Account: " + Login.accountUser + " ]");
                obj_StatusUpdate.startJobScrapingDetails(ref HttpHelper, lstLinkedinJobScraperInputUrl);
            }
            catch (Exception ex)
            {
                Console.Write(ex.Message);
            }
        }
Example #18
0
        public void StartDMMultiThreadedComposeMessage(object parameter)
        {
            try
            {
                if (Globals.IsStop)
                {
                    if (IsStopMessage)
                    {
                        return;
                    }
                    return;
                }
                Globals.lstComposeMessageThread.Add(Thread.CurrentThread);
                Globals.lstComposeMessageThread.Distinct().ToList();
                Thread.CurrentThread.IsBackground = true;
            }
            catch
            { }
            string Account = string.Empty;
            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;

                Account = item.Key;

                GlobusHttpHelper HttpHelper = new GlobusHttpHelper();
                GroupStatus MemberScrape = new GroupStatus();
                Login.logger.addToLogger += new EventHandler(ComposeMessage_addToLogger);
                MemberScrape.loggergrpupdate.addToLogger += new EventHandler(ComposeMessage_addToLogger);

                if (!Login.IsLoggedIn)
                {
                    //AddLoggerComposeMessage("[ " + DateTime.Now + " ] => [ Logging In With Email : " + item.Value._Username + " ]");
                    //                    AddLoggerComposeMessage("[ " + DateTime.Now + " ] => [ Login Process is Running... ]");
                    Login.LoginHttpHelper(ref HttpHelper);
                    if (Login.IsLoggedIn)
                    {
                        //AddLoggerComposeMessage("[ " + DateTime.Now + " ] => [ LoggedIn With Email : " + item.Value._Username + "]");
                    }
                    else
                    {
                        Login.LoginHttpHelper(ref HttpHelper);
                    }
                }

                try
                {
                    if (Login.IsLoggedIn)
                    {
                        //GroupStatus MemberScrape = new GroupStatus();
                        AddLoggerComposeMessage("[ " + DateTime.Now + " ] => [ Process Adding Members From Uploaded Emails is Running... ]");
                        if (GroupStatus.withExcelInput == true)
                        {
                            chkMessageTo.Invoke(new MethodInvoker(delegate
                            {
                                chkMessageTo.Items.Clear();
                                MessageContacts.Clear();
                            }));

                            Dictionary<string, string> Result = MemberScrape.PostaddMembersWithExcelInput(ref HttpHelper, Login.accountUser);
                            MessageContacts.Add(Login.accountUser, Result);
                        }
                        else
                        {
                            chkMessageTo.Invoke(new MethodInvoker(delegate
                            {
                                chkMessageTo.Items.Clear();
                                MessageContacts.Clear();
                            }));

                            GroupStatus.moduleLog = "composemsg";
                            Dictionary<string, string> Result = MemberScrape.PostAddMembers(ref HttpHelper, Login.accountUser);
                            MessageContacts.Add(Login.accountUser, Result);
                        }

                        AddLoggerComposeMessage("[ " + DateTime.Now + " ] => [ Member Added Successfully : " + Login.accountUser + " ]");

                        if (cmbMsgFrom.InvokeRequired)
                        {
                            new Thread(() =>
                            {
                                cmbMsgFrom.Invoke(new MethodInvoker(delegate
                                {
                                    cmbMsgFrom.Items.Add(Login.accountUser);
                                    cmbMsgFrom.SelectedIndex = 0;
                                }));
                            }).Start();
                        }
                    }
                    else
                    {
                        AddLoggerComposeMessage("[ " + DateTime.Now + " ] => [ Account : " + Login.accountUser + " Not Logged In ]");
                    }

                    Login.logger.addToLogger -= new EventHandler(ComposeMessage_addToLogger);
                    MemberScrape.loggergrpupdate.addToLogger += new EventHandler(ComposeMessage_addToLogger);

                }
                catch (Exception ex)
                {
                    GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> StartDMMultiThreadedComposeMessage() -->  Getting Contact Values --> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs);
                    GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> StartDMMultiThreadedComposeMessage() -->  Getting Contact Values -->" + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinComposeMessageErrorLogs);
                }
            }
            catch (Exception ex)
            {
                GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> StartDMMultiThreadedComposeMessage() --> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs);
                GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> StartDMMultiThreadedComposeMessage() --> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinComposeMessageErrorLogs);
            }
            finally
            {
                if (IsStopMessage)
                {
                    AddLoggerComposeMessage("[ " + DateTime.Now + " ] => [ Finished Adding Contacts To Email : " + Account + " ]");

                    counter_compose_msg--;
                    if (counter_compose_msg == 0)
                    {
                        if (btnMsgFrom.InvokeRequired)
                        {
                            btnMsgFrom.Invoke(new MethodInvoker(delegate
                            {
                                AddLoggerComposeMessage("[ " + DateTime.Now + " ] => [ PROCESS COMPLETED ]");
                                AddLoggerComposeMessage("--------------------------------------------------------------------------------------------------------------------------------");
                                btnMsgFrom.Cursor = Cursors.Default;
                            }));
                        }
                    }
                }
            }
        }
Example #19
0
        private void btnCheckPremAccount_Click(object sender, EventArgs e)
        {
            CheckNetConn = System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable();

            if (CheckNetConn)
            {

                try
                {
                    AddLoggerScrapeUsers("[ " + DateTime.Now + " ] => [ Process Running Please wait for sometimes... ]");

                    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)
                                {

                                    string acc = "";
                                    comboBoxemail.Invoke(new MethodInvoker(delegate
                                    {
                                        acc = comboBoxemail.SelectedItem.ToString();
                                        SearchCriteria.LoginID = comboBoxemail.SelectedItem.ToString();
                                    }));

                                    //Run a separate thread for each account
                                    LinkedInMaster item = new LinkedInMaster();
                                    LinkedInManager.linkedInDictionary.TryGetValue(acc, out item);

                                    item.logger.addToLogger += ScrapeEvent_addToLogger;
                                    item.LoginHttpHelper(ref HttpHelper);

                                    if (SearchCriteria.loginREsponce.Contains("Your LinkedIn account has been temporarily restricted"))
                                    {
                                        AddLoggerScrapeUsers("[ " + DateTime.Now + " ] => [ " + SearchCriteria.LoginID + "Your LinkedIn account has been temporarily restricted ]");
                                    }

                                    if (SearchCriteria.loginREsponce.Contains("Please confirm your email address"))
                                    {
                                        AddLoggerScrapeUsers("[ " + DateTime.Now + " ] => [ " + SearchCriteria.LoginID + " account has been temporarily restricted Please confirm your email address ]");
                                    }

                                    if (!item.IsLoggedIn)
                                    {
                                        AddLoggerScrapeUsers("[ " + DateTime.Now + " ] => [ Couldn't Login With : " + acc + " ]");
                                        return;
                                    }

                                    SearchCriteria.SignIN = true;
                                    SearchCriteria.SignOut = false;
                                    try
                                    {
                                        this.Invoke(new MethodInvoker(delegate
                                        {
                                            LoadCmboData();
                                        }));
                                    }
                                    catch
                                    {
                                    }
                                }
                            }
                            catch (Exception ex)
                            {
                                GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Check_Premium_Account() >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs);
                                GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Check_Premium_Account() >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinPreScrapperErrorLogs);
                            }
                        }
                    }
                }
                catch { }
            }
            else
            {
                MessageBox.Show("Your Internet Connection is disabled ! or not working, Please Check Your Internet Connection...");
                AddLoggerScrapeUsers("[ " + DateTime.Now + " ] => [ Your Internet Connection is disabled ! or not working, Please Check Your Internet Connection... ]");
            }
        }
Example #20
0
        public void StartDMMultiThreadedGroupMemberUser(object parameter)
        {
            try
            {
                try
                {
                    if (IsStop)
                    {
                        return;
                    }

                    if (!IsStop)
                    {
                        lstGroupMessageThread.Add(Thread.CurrentThread);
                        lstGroupMessageThread.Distinct().ToList();
                        Thread.CurrentThread.IsBackground = true;
                    }
                }
                catch (Exception ex)
                {
                    Console.WriteLine("Error >>> " + ex.StackTrace);
                }
                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(LinkedingrpLogEvents_addToLogger);

                if (!Login.IsLoggedIn)
                {
                    Login.LoginHttpHelper(ref HttpHelper);
                }

                try
                {
                    if (Login.IsLoggedIn)
                    {
                        GroupStatus dataScrape = new GroupStatus();
                        Thread.Sleep(2000);
                        Dictionary<string, string> Data = dataScrape.PostCreateGroupNames(ref HttpHelper, Login.accountUser);

                        GrpMemMess.Add(Login.accountUser, Data);

                        if (cmbAllUser.InvokeRequired)
                        {
                            new Thread(() =>
                            {
                                cmbAllUser.Invoke(new MethodInvoker(delegate
                                {
                                    if (!cmbAllUser.Items.Contains(Login.accountUser))
                                    {
                                        cmbAllUser.Items.Add(Login.accountUser);
                                    }
                                }));
                            }).Start();
                        }
                    }
                    else
                    {
                        //AddLoggerGroupMemMessage("LinkedIn account : " + Login.accountUser + " has been temporarily restricted");
                        //AddLoggerLinkedingrp("[ " + DateTime.Now + " ] => [ LinkedIn account : " + Login.accountUser + " has been temporarily restricted ]");
                    }
                }
                catch (Exception ex)
                {
                    GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> frmmain() --> StartDMMultiThreadedGroupMemberUser() >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs);
                    GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> frmmain() --> StartDMMultiThreadedGroupMemberUser() >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinGetGroupMemberErrorLogs);
                }

                finally
                {
                    counter_GroupMemberSearch--;

                    if (counter_GroupMemberSearch == 0)
                    {
                        if (cmbAllUser.InvokeRequired)
                        {
                            cmbAllUser.Invoke(new MethodInvoker(delegate
                            {
                                cmbAllUser.Enabled = true;
                                AddLoggerLinkedingrp("[ " + DateTime.Now + " ] => [ PROCESS COMPLETE..Please select Account ]");
                                AddLoggerLinkedingrp("----------------------------------------------------------------------------------------------------------------------------------------");
                                btnGetGroup.Cursor = Cursors.Default;
                            }));
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error >>> " + ex.StackTrace);
            }
        }
        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);
                        }
                    }
                }
            }
        }
Example #22
0
        public void StartDMMultiThreadedGroupMemmberAdd(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();
                    GroupStatus.moduleLog = "FriendsGroup";
                    Dictionary<string, string> Result = dataScrape.PostAddMembers(ref HttpHelper, Login.accountUser);
                    LinkdInContacts.Add(Login.accountUser, Result);

                    try
                    {
                        if (Result.Count > 0)
                        {
                            AddLoggerGroupAdd("[ " + DateTime.Now + " ] => [ Friends List..Added Successfully..in " + Login.accountUser + " ]");
                        }
                        else
                        {
                            AddLoggerGroupAdd("[ " + DateTime.Now + " ] => [ Friends List..Not Available..in " + Login.accountUser + " ]");
                        }
                    }
                    catch (Exception ex)
                    {
                        GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Add Friends Groups --> StartDMMultiThreadedGroupMemmberAdd() >> 1 >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs);
                        GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Add Friends Groups --> StartDMMultiThreadedGroupMemmberAdd() >> 2 >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinAddFriendsGroupErrorLogs);
                    }

                    if (cmbUser.InvokeRequired)
                    {
                        new Thread(() =>
                        {
                            cmbUser.Invoke(new MethodInvoker(delegate
                            {
                                cmbUser.Items.Add(Login.accountUser);
                            }));
                        }).Start();
                    }
                }
                else
                {
                    AddLoggerGroupAdd("[ " + DateTime.Now + " ] => [ LinkedIn Account : " + Login.accountUser + " has been temporarily restricted ]");
                }
            }
            catch (Exception ex)
            {
                GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Add Friends Groups --> StartDMMultiThreadedGroupMemmberAdd() >> 2 >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs);
                GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Add Friends Groups --> StartDMMultiThreadedGroupMemmberAdd() >> 2>>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinAddFriendsGroupErrorLogs);
            }
            finally
            {
                counter_GroupMemberSearch--;

                if (counter_GroupMemberSearch == 0)
                {
                    if (btnAddGroups.InvokeRequired)
                    {
                        btnAddGroups.Invoke(new MethodInvoker(delegate
                        {
                            btnAddGroups.Enabled = true;
                            AddLoggerGroupAdd("[ " + DateTime.Now + " ] => [ PROCESS COMPLETED ]");
                            AddLoggerGroupAdd("------------------------------------------------------------------------------------------------------------------------------------");
                            btnExistGroup.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;

                    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);
                        }
                    }
                }
            }
        }
Example #24
0
        public void StartDMMultiThreadedGroupUser(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);
                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);

                Login.logger.addToLogger += new EventHandler(AddToLogger_GroupStatus);

                if (!Login.IsLoggedIn)
                {
                    Login.LoginHttpHelper(ref HttpHelper);
                }

                AddLoggerGroupStatus("[ " + DateTime.Now + " ] => [ Starting Search For Groups >>> To Send Group Messages ]");

                try
                {
                    if (Login.IsLoggedIn)
                    {
                        GroupStatus dataScrape = new GroupStatus();
                        Dictionary<string, string> Data = new Dictionary<string, string>();
                        Data.Clear();

                        Data = obj_GroupUpdate.PostCreateGroupNames(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();
                        }

                        AddLoggerGroupStatus("[ " + DateTime.Now + " ] => [ Groups Added in : " + item.Value._Username + "]");
                    }
                    else
                    {
                        AddLoggerGroupStatus("[ " + 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
                            {
                                AddLoggerGroupStatus("[ " + DateTime.Now + " ] => [ PROCESS COMPLETED ]");
                                AddLoggerGroupStatus("-------------------------------------------------------------------------------------------------------------------------");
                                cmbGroupUser.Enabled = true;
                                btnGetUser.Cursor = Cursors.Default;

                            }));
                        }

                        //btnGetUser.Invoke(new MethodInvoker(delegate
                        //{
                        //    AddLoggerGroupStatus("[ " + DateTime.Now + " ] => [ PROCESS COMPLETED ]");
                        //    AddLoggerGroupStatus("-------------------------------------------------------------------------------------------------------------------------");

                        //    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);
            }
        }
        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);
                }
            }
        }
Example #26
0
        public void StartDMMultiThreadedMemmbersGroupAdd(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 Groups --> StartDMMultiThreadedMemmbersGroupAdd() ---1--->>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs);
                        GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Add Friends Groups --> StartDMMultiThreadedMemmbersGroupAdd() ---1--->>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinAddFriendsGroupErrorLogs);
                    }
                }

                GroupStatus dataScrape = new GroupStatus();
                Dictionary<string, string> Groups = dataScrape.PostAddGroupNames(ref HttpHelper, MemId);

                try
                {
                    GrpAdd.Add(Login.accountUser, Groups);
                    AddLoggerGroupAdd("[ " + DateTime.Now + " ] => [ Groups..Added Successfully.. ]");
                }
                catch (Exception ex)
                {
                    GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Add Friends Groups --> StartDMMultiThreadedMemmbersGroupAdd() ---2--->>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs);
                    GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Add Friends Groups --> StartDMMultiThreadedMemmbersGroupAdd() ---2--->>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinAddFriendsGroupErrorLogs);
                }

                string GetUserID = string.Empty;
                this.Invoke(new MethodInvoker(delegate
                {
                    chkExistGroup.Items.Clear();
                    GetUserID = cmbUser.SelectedItem.ToString();
                }));

                try
                {
                    foreach (KeyValuePair<string, Dictionary<string, string>> Grps in GrpAdd)
                    {
                        try
                        {
                            if (GetUserID.Contains(Grps.Key))
                            {
                                Dictionary<string, string> GmUserIDs = Grps.Value;
                                AddLoggerGroupAdd("[ " + DateTime.Now + " ] => [ " + GmUserIDs.Count() + " Groups in List ]");

                                foreach (KeyValuePair<string, string> item1 in Grps.Value)
                                {
                                    try
                                    {
                                        chkExistGroup.Invoke(new MethodInvoker(delegate
                                        {
                                            chkExistGroup.Items.Add(item1.Key);
                                            GetUserID = cmbUser.SelectedItem.ToString();
                                        }));
                                    }
                                    catch (Exception ex)
                                    {
                                    }
                                }
                            }
                        }
                        catch (Exception ex)
                        {
                        }
                    }
                }
                catch (Exception ex)
                {
                    GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Add Friends Groups --> StartDMMultiThreadedMemmbersGroupAdd() ---3--->>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs);
                    GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Add Friends Groups --> StartDMMultiThreadedMemmbersGroupAdd() ---3--->>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinAddFriendsGroupErrorLogs);
                }

                AddLoggerComposeMessage("[ " + DateTime.Now + " ] => [ Finished Adding Groups of Users ]");
            }
            catch (Exception ex)
            {
                GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Add Friends Groups --> StartDMMultiThreadedMemmbersGroupAdd() ---4--->>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs);
                GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Add Friends Groups --> StartDMMultiThreadedMemmbersGroupAdd() ---4--->>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinAddFriendsGroupErrorLogs);
            }
            finally
            {
                this.Invoke(new MethodInvoker(delegate
                {
                    AddLoggerGroupAdd("[ " + DateTime.Now + " ] => [ PROCESS COMPLETED ]");
                    AddLoggerGroupAdd("------------------------------------------------------------------------------------------------------------------------------------");
                    btnAddGroups.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;
                        }));
                }

            }
        }
Example #28
0
        public void StartDMMultiThreadedSearchOpenGroups(object parameter)
        {
            try
            {
                if (IsStop)
                {
                    return;
                }

                if (!IsStop)
                {
                    lstJoinSearchGroupThread.Add(Thread.CurrentThread);
                    lstJoinSearchGroupThread.Distinct().ToList();
                    Thread.CurrentThread.IsBackground = true;
                }
            }
            catch
            {
            }
            Array paramsArray = new object[1];
            int notLoged = 0;
            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;

            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);
            obj_JoinSearchGroup.logger.addToLogger += new EventHandler(logger_SearchGroupaddToLogger);

            GlobusHttpHelper HttpHelper = new GlobusHttpHelper();

            if (!Login.IsLoggedIn)
            {
                Login.LoginHttpHelper(ref HttpHelper);
            }

            AddLoggerSearchGroup("[ " + DateTime.Now + " ] => [ Searching Groups Process Running..Please wait for sometimes.. ]");

            if (Login.IsLoggedIn)
            {
                GroupStatus dataScrape = new GroupStatus();
                try
                {
                    Result = obj_JoinSearchGroup.PostAddOpenGroups(ref HttpHelper, txtSearchKeyword.Text.ToString().Trim(), item.Value._Username);

                    int count = 5;
                    if (!string.IsNullOrEmpty(txtBoxGroupCount.Text) && NumberHelper.ValidateNumber(txtBoxGroupCount.Text))
                    {
                        count = Convert.ToInt32(txtBoxGroupCount.Text);
                    }

                    LinkdInContacts.Add(Login.accountUser, Result);
                }
                catch (Exception ex)
                {
                    GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Add Search Groups --> StartDMMultiThreadedSearchOpenGroups() ---1--->>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs);
                    GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Add Search Groups --> StartDMMultiThreadedSearchOpenGroups() ---1--->>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinAddSearchGroupErrorLogs);
                }

                try
                {
                    if (Result.Count == 0)
                    {
                        AddLoggerSearchGroup("[ " + DateTime.Now + " ] => [ Sorry, there are no group Search results matching your search criteria.. ]");
                    }
                    else
                    {
                        AddLoggerSearchGroup("[ " + DateTime.Now + " ] => [ Groups..Searched Successfully..For " + Login.accountUser + " ]");

                        if (cmbSearchGroup.InvokeRequired)
                        {
                            new Thread(() =>
                            {
                                cmbSearchGroup.Invoke(new MethodInvoker(delegate
                                {
                                    cmbSearchGroup.Items.Add(Login.accountUser);
                                }));
                            }).Start();
                        }
                    }
                }
                catch (Exception ex)
                {
                    GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Add Search Groups --> StartDMMultiThreadedSearchOpenGroups() ---2--->>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs);
                    GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Add Search Groups --> StartDMMultiThreadedSearchOpenGroups() ---2--->>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinAddSearchGroupErrorLogs);
                }
                finally
                {
                    obj_JoinSearchGroup.logger.addToLogger -= new EventHandler(logger_SearchGroupaddToLogger);

                    counter_GroupMemberSearch--;
                    int aaa = counter_GroupMemberSearch - notLoged;
                    if (counter_GroupMemberSearch == aaa)
                    {
                        if (cmbSearchGroup.InvokeRequired)
                        {
                            cmbSearchGroup.Invoke(new MethodInvoker(delegate
                            {
                                AddLoggerSearchGroup("[ " + DateTime.Now + " ] => [ PROCESS COMPLETED ]");
                                AddLoggerSearchGroup("----------------------------------------------------------------------------------------------------------------------------------------");
                                cmbSearchGroup.Enabled = true;
                                btnAddSearchGroup.Cursor = Cursors.Default;

                            }));
                        }
                    }
                }
            }
            else
            {
                AddLoggerSearchGroup("[ " + DateTime.Now + " ] => [ Account : " + Login.accountUser + " Not Logged In ]");
                if (notLoged == 0)
                {
                    notLoged = 1;
                }
                else
                {
                    notLoged = +notLoged;
                }
            }
        }
        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;
                        }));
                }
            }
        }
Example #30
0
        public void StartLinkedinShare()
        {
            GlobusHttpHelper objGlobusHttpHelper = new GlobusHttpHelper();

            #region thread is stopped or not
            try
            {
                if (!_isStop_Share)
                {
                    lstShareThread.Add(Thread.CurrentThread);
                    lstShareThread.Distinct().ToList();
                    Thread.CurrentThread.IsBackground = true;
                }
            }
            catch
            { }
            #endregion

            try
            {
                AddLoggerShare("[ " + DateTime.Now + " ] => [ Logging in With UserName >>> " + shareSelectedEmailId + " ]");

                //objGlobusHttpHelper.gCookies = null;
                if (SearchCriteria.SignIN)
                {
                    LinkedinLogin Login = new LinkedinLogin();
                    //For Sign Out +9+
                    Login.LoginHttpHelper(ref objGlobusHttpHelper);

                    SearchCriteria.SignOut = true;
                }
                if (SearchCriteria.SignOut)
                {
                    LinkedInMaster item = null;
                    LinkedInManager.linkedInDictionary.TryGetValue(shareSelectedEmailId, out item);

                    item.LoginHttpHelper(ref objGlobusHttpHelper);

                    AddLoggerShare("[ " + DateTime.Now + " ] => [ Login Process is running... ]");
                    if (item.IsLoggedIn)
                    {
                        if (SearchCriteria.loginREsponce.Contains("[ " + DateTime.Now + " ] => [ Your LinkedIn account has been temporarily restricted ]"))
                        {
                            AddLoggerShare("[ " + DateTime.Now + " ] => [ " + shareSelectedEmailId + "Your LinkedIn account has been temporarily restricted ]");

                        }

                        if (SearchCriteria.loginREsponce.Contains("Please confirm your email address"))
                        {
                            AddLoggerShare("[ " + DateTime.Now + " ] => [ " + shareSelectedEmailId + " account has been temporarily restricted Please confirm your email address ]");

                        }
                        SearchCriteria.SignIN = true;
                        SearchCriteria.SignOut = false;
                        if (item.IsLoggedIn)
                        {
                            AddLoggerShare("[ " + DateTime.Now + " ] => [ Logged in Successfully With UserName >>> " + shareSelectedEmailId + " ]");
                        }
                        else
                        {
                            AddLoggerShare("[ " + DateTime.Now + " ] => [ Couldn't Login   With UserName >>> " + shareSelectedEmailId + " ]");
                        }
                    }
                    else
                    {
                        AddLoggerShare("[ " + DateTime.Now + " ] => [ Couldn't Login With UserName >>> " + shareSelectedEmailId + " ]");
                        return;
                    }

                    SearchCriteria.LoginID = item._Username;

                    //Check HERE!!!!
                    try
                    {
                        foreach (string webUrlAndShareText in lstLinkedinShareWebsiteUrl)
                        {
                            UrlShare(ref objGlobusHttpHelper, item._Username, item._Password, item._ProxyAddress, item._ProxyPort, item._ProxyUsername, item._ProxyPassword, webUrlAndShareText);
                        }
                    }
                    catch { }

                    finally
                    {
                        if (btnShareStart.InvokeRequired)
                            btnShareStart.Invoke(new MethodInvoker(delegate
                            {
                                AddLoggerShare("[ " + DateTime.Now + " ] => [ PROCESS COMPLETED ]");
                            }));
                    }
                }
            }
            catch
            { }
        }