Exemplo n.º 1
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... ]");
            }
        }
Exemplo n.º 2
0
        private void StartLinkedinSearch()
        {
            try
            {
                #region Check condition Thread is Stop or Not

                if (_IsStop_LinkedinSearch)
                {
                    return;
                }

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

                #endregion

                //foreach (KeyValuePair<string, LinkedInMaster> item in LinkedInManager.linkedInDictionary)
                {
                    try
                    {
                        if (Globals.scrapeWithoutLoggingIn)
                        {

                        }

                        if (SearchCriteria.SignIN)
                        {
                            LinkedinLogin Login = new LinkedinLogin();
                            //For Sign Out
                            Login.LogoutHttpHelper();

                            SearchCriteria.SignOut = true;
                        }
                        //Run a separate thread for each account

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

                            if (rdbLinkedinSearchKeyword.Checked)
                            {
                                //AddLoggerLinkedinSearch("[ " + DateTime.Now + " ] => [ Please Wait Login In With UserName >>> " + _LinkedinSearchSelectedEmailId + " ]");
                                item.LoginHttpHelper(ref HttpHelper);

                                if (item.IsLoggedIn)
                                {
                                    if (SearchCriteria.loginREsponce.Contains("[ " + DateTime.Now + " ] => [ Your LinkedIn account has been temporarily restricted ]"))
                                    {
                                        AddLoggerLinkedinSearch("[ " + DateTime.Now + " ] => [ " + _LinkedinSearchSelectedEmailId + "Your LinkedIn account has been temporarily restricted ]");

                                        if (rdbLinkedinSearchKeyword.Checked)
                                        {
                                            return;
                                        }
                                    }

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

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

                            if (rdbLinkedinSearchKeyword.Checked)
                            {
                                AddLoggerLinkedinSearch("[ " + DateTime.Now + " ] => [ Keyword Search Process Starting..... ]");
                            }
                            if (rdbLinkedinSearchURL.Checked)
                            {
                                AddLoggerLinkedinSearch("[ " + DateTime.Now + " ] => [ Profile Search Process Starting..... ]");
                            }

                            InBoardProGetData.LinkedinSearch obj_LinkedinSearch = new InBoardProGetData.LinkedinSearch(item._Username, item._Password, item._ProxyAddress, item._ProxyPort, item._ProxyUsername, item._ProxyPassword);

                            SearchCriteria.LoginID = item._Username;

                            if (_IsKeyword_LinkedinSearch)
                            {
                                obj_LinkedinSearch._RdbKeyword = true;
                                obj_LinkedinSearch._RdbURL = false;
                            }
                            if (_IsProfileURL_LinkedinSearch)
                            {
                                obj_LinkedinSearch._RdbKeyword = false;
                                obj_LinkedinSearch._RdbURL = true;
                            }

                            obj_LinkedinSearch.logger.addToLogger += new EventHandler(LinkedinSearchLogEvents_addToLogger);

                            obj_LinkedinSearch.StartLinkedInSearch(ref HttpHelper);

                            obj_LinkedinSearch.logger.addToLogger -= new EventHandler(LinkedinSearchLogEvents_addToLogger);
                        }
                    }
                    catch
                    {
                    }
                }
            }
            catch
            {
            }
            finally
            {
                btnLinkedinSearch.Invoke(new MethodInvoker(delegate
                {
                    AddLoggerLinkedinSearch("[ " + DateTime.Now + " ] => [ PROCESS COMPLETED ]");
                    AddLoggerLinkedinSearch("------------------------------------------------------------------------------------------------------------------------------------");
                    btnLinkedinSearch.Cursor = Cursors.Default;
                }));
            }
        }
Exemplo n.º 3
0
        private bool Login_InBoardProGetDataForCampaignScraper(ref GlobusHttpHelper HttpHelper, string Account, string password, string ProxyAddress, string ProxyPort, string ProxyUserName, string ProxyPassword)
        {
            //Thread.Sleep(1 * 60 * 1000);

            bool isLoggedin = false;
            try
            {
                //this.Invoke(new MethodInvoker(delegate
                //{
                try
                {
                    if (!this.IsHandleCreated)
                    {
                        string abc = "handle not created";
                    }

                    this.Invoke(new MethodInvoker(delegate
                    {
                        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)
                            //  {
                            //GlobusHttpHelper httpHelper = new GlobusHttpHelper();
                            string acc = "";
                            //comboBoxemail.Invoke(new MethodInvoker(delegate
                            //  {
                            //    acc = comboBoxemail.SelectedItem.ToString();
                            //     SearchCriteria.LoginID = comboBoxemail.SelectedItem.ToString();//change 21/08/12
                            // }));
                            //string acc = account.Remove(account.IndexOf(':'));

                            //Run a separate thread for each account

                            SearchCriteria.LoginID = Account;
                            //LinkedInMaster item = null;
                            LinkedInMaster item = new LinkedInMaster();
                            //LinkedInManager.linkedInDictionary.TryGetValue(acc, out item);

                            //item.logger.addToLogger += ScrapeEvent_addToLogger;
                            item.LoginHttpHelperForCampaignScraper(ref HttpHelper, Account, password, ProxyAddress, ProxyPort, ProxyUserName, ProxyPassword);

                            if (item.IsLoggedIn)
                            {
                                AddLoggerScrapeUsers("[ " + DateTime.Now + " ] => [ Logged in With Account : " + Account + " ]");
                                isLoggedin = true;
                            }

                            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 : " + Account + " ]");
                            }

                            SearchCriteria.SignIN = true;
                            SearchCriteria.SignOut = false;
                            try
                            {
                                this.Invoke(new MethodInvoker(delegate
                                {
                                    //LoadCmboData();
                                }));
                            }
                            catch
                            {
                            }
                            // }
                        }
                        catch (Exception ex)
                        {
                            GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> comboBoxemail_SelectedIndexChanged() >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs);
                            GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> comboBoxemail_SelectedIndexChanged() >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinPreScrapperErrorLogs);
                        }
                        // }
                    }
                }
                catch
                {
                }
                //}));
                //DisableEnableScrapperControls();
            }
            catch
            {
            }

            return isLoggedin;
        }
Exemplo n.º 4
0
        private void Method_comboBoxemail_SelectedIndexChanged()
        {
            try
            {
                //this.Invoke(new MethodInvoker(delegate
                //{
                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)
                                {
                                    //GlobusHttpHelper httpHelper = new GlobusHttpHelper();
                                    string acc = "";
                                    comboBoxemail.Invoke(new MethodInvoker(delegate
                                    {
                                        acc = comboBoxemail.SelectedItem.ToString();
                                        SearchCriteria.LoginID = comboBoxemail.SelectedItem.ToString();//change 21/08/12
                                    }));
                                    //string acc = account.Remove(account.IndexOf(':'));

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

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

                                    if (item.IsLoggedIn)
                                    {
                                        AddLoggerScrapeUsers("[ " + DateTime.Now + " ] => [ Logged in With : " + acc + " ]");

                                    }

                                    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 --> comboBoxemail_SelectedIndexChanged() >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs);
                                GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> comboBoxemail_SelectedIndexChanged() >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinPreScrapperErrorLogs);
                            }
                        }
                    }
                }
                catch
                {
                }
                //}));
                //DisableEnableScrapperControls();
            }
            catch
            {
            }
        }
        private bool Login_InBoardProGetData()
        {
            bool isLoggedin = false;
            try
            {
                try
                {
                    AddLoggerCompanyEmployeeSearch("[ " + DateTime.Now + " ] => [ Process Running Please wait...]");

                    if (SearchCriteria.SignIN)
                    {
                        LinkedinLogin Login = new LinkedinLogin();
                        //For Sign Out
                        Login.LogoutHttpHelper();
                        SearchCriteria.SignOut = true;
                    }

                    if (SearchCriteria.SignOut)
                    {
                        SearchCriteria.LoginID = string.Empty;
                        if (LinkedInManager.linkedInDictionary.Count() > 0)
                        {
                            try
                            {
                                object temp = null;
                                comboBoxemail.Invoke(new MethodInvoker(delegate
                                {
                                    temp = comboBoxemail.SelectedItem;
                                }));

                                if (temp != null)
                                {
                                    //GlobusHttpHelper httpHelper = new GlobusHttpHelper();
                                    string acc = "";
                                    comboBoxemail.Invoke(new MethodInvoker(delegate
                                    {
                                        acc = comboBoxemail.SelectedItem.ToString();
                                        SearchCriteria.LoginID = comboBoxemail.SelectedItem.ToString();//change 21/08/12
                                    }));
                                    //string acc = account.Remove(account.IndexOf(':'));

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

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

                                    if (item.IsLoggedIn)
                                    {
                                        AddLoggerCompanyEmployeeSearch("[ " + DateTime.Now + " ] => [ Logged in With : " + acc + " ]");
                                        isLoggedin = true;
                                    }

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

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

                                    if (!item.IsLoggedIn)
                                    {
                                        AddLoggerCompanyEmployeeSearch("[ " + DateTime.Now + " ] => [ Couldn't Login With : " + acc + " ]");
                                    }
                                   // InBoardPro.LinkedinSearch obj_LinkedinSearch = new InBoardPro.LinkedinSearch(item._Username, item._Password, item._ProxyAddress, item._ProxyPort, item._ProxyUsername, item._ProxyPassword);
                                    SearchCriteria.SignIN = true;
                                    SearchCriteria.SignOut = false;

                                }
                            }
                            catch (Exception ex)
                            {
                                GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> comboBoxemail_SelectedIndexChanged() >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs);
                                GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> comboBoxemail_SelectedIndexChanged() >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinPreScrapperErrorLogs);
                            }
                        }
                    }
                }
                catch
                {
                }

            }
            catch
            {
            }

            return isLoggedin;
        }