public void StartInBoardProGetData(string args)
        {
            try
            {
                string[] ParameterData_Split = Regex.Split(args, ":");
                string Account = ParameterData_Split[0];
                string password = ParameterData_Split[1];
                string ProxyAddress = ParameterData_Split[2];
                string ProxyPort = ParameterData_Split[3];
                string ProxyUserName = ParameterData_Split[4];
                string ProxyPassword = ParameterData_Split[5];
                string FirstName = ParameterData_Split[7];
                string LastName = ParameterData_Split[8];
                string Location = ParameterData_Split[9];
                string Country = ParameterData_Split[10];
                string LocationArea = ParameterData_Split[11];
                string PostalCode = ParameterData_Split[12];
                string Company = ParameterData_Split[13];
                string Keyword = ParameterData_Split[14];
                string Title = ParameterData_Split[15];
                string IndustryType = ParameterData_Split[16];
                string Relationship = ParameterData_Split[17];
                string language = ParameterData_Split[18];
                string Groups = ParameterData_Split[19];
                string FileName = ParameterData_Split[20];
                string TitleValue = ParameterData_Split[21];
                string CompanyValue = ParameterData_Split[22];
                string within = ParameterData_Split[23];
                string YearsOfExperience = ParameterData_Split[24];
                string Function = ParameterData_Split[25];
                string SeniorLevel = ParameterData_Split[26];
                string IntrestedIn = ParameterData_Split[27];
                string CompanySize = ParameterData_Split[28];
                string Fortune1000 = ParameterData_Split[29];
                string RecentlyJoined = ParameterData_Split[30];

                GlobusHttpHelper HttpHelper = new GlobusHttpHelper();
                LinkedInScrape objlinkscr = new LinkedInScrape();
                LinkedInMaster objLinkedInMaster = new LinkedInMaster();

                AddToLogger("[ " + DateTime.Now + " ] => [ Logging with Account :  " + Account + " ]");
                objLinkedInMaster.LoginHttpHelperForCampaignScraper(ref HttpHelper, Account, password, ProxyAddress, ProxyPort, ProxyUserName, ProxyPassword);

                if (objLinkedInMaster.IsLoggedIn)
                {
                    AddToLogger("[ " + DateTime.Now + " ] => [ Logged in  with Account :  " + Account + " ]");
                    AddToLogger("[ " + DateTime.Now + " ] => [ Start LinkedIn Crawling ]");
                    StartCampaignInBoardProGetDataWithPagination(ref HttpHelper, Account, FirstName, LastName, Location, Country, LocationArea, PostalCode, Company, Keyword, Title, IndustryType, Relationship, language, Groups, FileName, TitleValue, CompanyValue, within, YearsOfExperience, Function, SeniorLevel, IntrestedIn, CompanySize, Fortune1000, RecentlyJoined);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error >>> " + ex.StackTrace);
            }
            finally
            {

            }
        }
Example #2
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... ]");
            }
        }
        public void SearchConnection(ref GlobusHttpHelper GlobusHttpHelper, string Email, string Password, string proxyAddress, int ProxyPort, string proxyUsername, string proxyPassword)
        {
           
            try
            {
                Campaign_lstSearchconnectionThread.Clear();


                int SearchMinDelay = 0;
                int SearchMaxDelay = 0;
                bool DelayReset = true;
                if (chkUniqueConnectin.Checked)
                {
                    ManageConnections.ConnectUsing_Search.UseuniqueConn = true;
                    foreach (string itemKeyword in CampainGroupCreate.Campaign_lstConnectionSearchKeyword)
                    {
                        try
                        {
                            ManageConnections.ConnectUsing_Search.lstQueuKeywords.Enqueue(itemKeyword);

                        }
                        catch { }
                    }
                }

                if (CampainGroupCreate.Campaign_lstConnectionSearchKeyword.Count == 0)
                {
                    MessageBox.Show("Please Add Keywords!");
                    AddLoggerLinkedInProfileManager("[ " + DateTime.Now + " ] => [ Please Add Keywords! ]");
                    return;
                }
                else
                {
                    Queue<string> que_SearchKeywords = new Queue<string>();
                    foreach (string itemKeyword in CampainGroupCreate.Campaign_lstConnectionSearchKeyword)
                    {
                        que_SearchKeywords.Enqueue(itemKeyword);
                    }

                    LinkedInMaster LinkedIn_Master = new LinkedInMaster();
                    ManageConnections.ConnectUsing_Search ConnectUsing_Search = new ConnectUsing_Search(Email, Password, proxyAddress, ProxyPort.ToString(), proxyUsername, proxyPassword, que_SearchKeywords);
                    ManageConnections.ConnectUsing_Search.ConnectSearchUsingkeyword(ref ConnectUsing_Search, SearchMinDelay, SearchMaxDelay);
       
                    //ConnectUsing_Search.ConnectionSearch();

                    //ConnectUsingSearch obj_ConnectUsingSearch = new ConnectUsingSearch(Email, Password, proxyAddress, ProxyPort.ToString(), proxyUsername, proxyPassword);
                    //obj_ConnectUsingSearch.ConnectionSearch();
                }
               
               

            }
            catch (Exception ex)
            {
                GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Add Connection --> btnSearchConnection_Click() >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs);
                GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Add Connection --> btnSearchConnection_Click() >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinAddConnectionErrorLogs);
            }
        } 
Example #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
            {
            }
        }
Example #5
0
        private void ReloadAccountsFromDataBase()
        {
            try
            {
                clsLDAccount objclsFBAccount = new clsLDAccount();
                DataTable dt = objclsFBAccount.SelectAccoutsForGridView();

                if (dt.Rows.Count > 0)
                {
                    Globals.listAccounts.Clear();
                    LinkedInManager.linkedInDictionary.Clear();
                    ///Add LinkedIn instances to LinkedInAccountContainer.dictionary_LinkedInDictionary
                    foreach (DataRow dRow in dt.Rows)
                    {
                        try
                        {
                            LinkedInMaster linkedin = new LinkedInMaster();
                            linkedin._Username = dRow[0].ToString();
                            linkedin._Password = dRow[1].ToString();
                            linkedin._ProxyUsername = dRow[2].ToString();
                            linkedin._ProxyPort = dRow[3].ToString();
                            linkedin._ProxyUsername = dRow[4].ToString();
                            linkedin._ProxyPassword = dRow[5].ToString();

                            if (!string.IsNullOrEmpty(dRow[5].ToString()))
                            {
                                linkedin.profileStatus = int.Parse(dRow[5].ToString());
                            }

                            Globals.listAccounts.Add(linkedin._Username + ":" + linkedin._Password + ":" + linkedin._ProxyAddress + ":" + linkedin._ProxyPort + ":" + linkedin._ProxyUsername + ":" + linkedin._ProxyPassword);
                            LinkedInManager.linkedInDictionary.Add(linkedin._Username, linkedin);
                        }
                        catch (Exception ex)
                        {
                            Console.WriteLine(ex.StackTrace);
                            GlobusFileHelper.AppendStringToTextfileNewLine(DateTime.Now + " --> Error --> ReloadAccountsFromDataBase() -- Rows From DB --> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_ProxySettingErroLog);
                            GlobusFileHelper.AppendStringToTextfileNewLine("Error --> ReloadAccountsFromDataBase() -- Rows From DB --> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs);
                        }
                    }
                    Console.WriteLine(Globals.listAccounts.Count + " Accounts loaded");
                    AddLoggerGeneral("[ " + DateTime.Now + " ] => [ " + Globals.listAccounts.Count + " Accounts loaded ]");
                }
            }
            catch (Exception ex)
            {
                GlobusFileHelper.AppendStringToTextfileNewLine(DateTime.Now + " --> Error --> ReloadAccountsFromDataBase() --> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_ProxySettingErroLog);
                GlobusFileHelper.AppendStringToTextfileNewLine("Error --> ReloadAccountsFromDataBase() --> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs);
            }
        }
Example #6
0
        private void btnStartProfileCreation_Click(object sender, EventArgs e)
        {
            string username = string.Empty;
            string password = string.Empty;
            // BaseLib.clsSettingDB objClsSettingDb = new BaseLib.clsSettingDB();
            // objClsSettingDb.InsertOrUpdateSetting("ProfileManager", "PicsFolder", StringEncoderDecoder.Encode(txtProfilePicsFolder.Text));
            DataSet DS = DataBaseHandler.SelectQuery("select UserName , Password from tb_LinkedInAccount", "tb_LinkedInAccount");
            foreach (DataRow theRow in DS.Tables["tb_LinkedInAccount"].Rows)
            {
                username = theRow.ItemArray[0].ToString();
                LinkedInMaster obj = new LinkedInMaster();
                password = theRow.ItemArray[1].ToString();
                obj._Password = password;
            }

            new Thread(() => ProfileCreationThread()).Start();
        }
Example #7
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;
        }
        public void GetStartProcessForFollow(object paramarray)
        {
            string CampaignName = string.Empty;
            try
            {
                Interlocked.Increment(ref counterThreadsCampaignFollow);

                string Account = string.Empty;
                Array paramsArray = new object[5];
                paramsArray = (Array)paramarray;

                KeyValuePair<string, CampaignAccountManager> keyValuePair = (KeyValuePair<string, CampaignAccountManager>)paramsArray.GetValue(0);
                LinkedinLogin Login = new LinkedinLogin();
                //KeyValuePair<string, LinkedInMaster> item = (KeyValuePair<string, LinkedInMaster>)paramsArray.GetValue(0);
                GlobusHttpHelper HttpHelper = new GlobusHttpHelper();
                LinkedInMaster LinkedIn_Master1 = new LinkedInMaster();
                CampaignAccountManager LinkedIn_Master = keyValuePair.Value;
                string linkedInKey = keyValuePair.Key;
                Account = keyValuePair.Key;

                string SearchType = (string)paramsArray.GetValue(1);

                int KeywordFilePath = (int)paramsArray.GetValue(2);

                int UrlFilePath = (int)paramsArray.GetValue(3);

                int DelayStart = (int)paramsArray.GetValue(4);

                int DelayEnd = (int)paramsArray.GetValue(5);

                CampaignName = (string)paramsArray.GetValue(6);

                bool IsSchedulDaily = (bool)paramsArray.GetValue(7);

                DateTime SchedulerStartTime = (DateTime)paramsArray.GetValue(7);

                DateTime SchedulerEndTime = (DateTime)paramsArray.GetValue(8);

                //bool IsInviteperDay = (bool)paramsArray.GetValue(8);

                //int NumberOfInivitePerDay = (int)paramsArray.GetValue(9);

                //string Message = (string)paramsArray.GetValue(10);

                //bool Isspintax = (bool)paramsArray.GetValue(11);
                //Initialize Values in Local Variable

                string accKey = (string)keyValuePair.Key;
                CampaignAccountManager campACCManager = (CampaignAccountManager)keyValuePair.Value;

                //Add List Of Working thread
                //we are using this list when we stop/abort running camp processes..
                try
                {
                    cls_variables.Lst_WokingThreads.Add(CampaignName + "_" + campACCManager.Username, Thread.CurrentThread);
                }
                catch (Exception)
                {
                }

                //
                ////////
                // JOIN GROUP METHOD!!
                ///////
                //
            }
            catch (Exception)
            {
            }
            finally
            {
                ////count_AccountforCampaignFollower--;
                //Interlocked.Decrement(ref counterThreadsCampaignFollow);
                //lock (lockerThreadsCampaignFollow)
                //{
                //    Monitor.Pulse(lockerThreadsCampaignFollow);
                //}
                if (counterThreadsCampaignFollow == 0)
                {
                    AddLoggerManageConnection("[ " + DateTime.Now + " ] => [ Process is completed for Campaign " + CampaignName + " ]");
                    //_IsFollowProcessStart = true;
                }
            }
        }
        private void LinkedInStartScrapperThread()
        {
            foreach (string[] itemArr in listArrSftwareinputData)
            {
                try
                {

                    LinkedInMaster objLinkedInMaster = new LinkedInMaster();
                    if (!itemArr[0].Contains("PostalCode"))
                    {
                        try
                        {
                            if (!string.IsNullOrEmpty(itemArr[0]))
                            {
                                objLinkedInMaster._Postalcode = itemArr[0];
                            }

                        }
                        catch { }
                        try
                        {
                            if (!string.IsNullOrEmpty(itemArr[1]))
                            {
                                objLinkedInMaster._Distance = itemArr[1];
                            }
                        }
                        catch { }
                        try
                        {
                            if (!string.IsNullOrEmpty(itemArr[2]))
                            {
                                objLinkedInMaster._IndustryType = itemArr[2];
                            }
                        }
                        catch { }
                        try
                        {
                            if (!string.IsNullOrEmpty(itemArr[3]))
                            {
                                objLinkedInMaster._LastName = itemArr[3];
                            }
                        }
                        catch { }
                        try
                        {
                            if (!string.IsNullOrEmpty(itemArr[4]))
                            {
                                objLinkedInMaster._Username = itemArr[4];
                            }
                        }
                        catch { }
                        try
                        {
                            if (!string.IsNullOrEmpty(itemArr[5]))
                            {
                                objLinkedInMaster._Password = itemArr[5];
                            }
                        }
                        catch { }
                        try
                        {
                            // objLinkedInMaster._ProxyAddress = itemArr[6];
                            if (!string.IsNullOrEmpty(itemArr[6]))
                            {
                                string[] words = itemArr[6].Split(new char[] { char.Parse(":") });
                                if (words.Count() > 1)
                                {
                                    try
                                    {
                                        string Portno = words[1];
                                        objLinkedInMaster._ProxyPort = Portno;
                                        objLinkedInMaster._ProxyAddress = words[0]; //+ ":" + words[1] + ":" + words[2] + ":" + words[3];
                                    }
                                    catch { }
                                }
                                else
                                {
                                    try
                                    {
                                        objLinkedInMaster._ProxyAddress = words[0];// +":" + words[1] + ":" + words[2] + ":" + words[3];
                                    }
                                    catch { }

                                }
                            }
                            //string[] Arrport=Regex.Split(itemArr[6], ":");
                        }
                        catch { }
                        try
                        {
                            if (!string.IsNullOrEmpty(itemArr[7]))
                            {
                                objLinkedInMaster._ProxyPassword = itemArr[7];
                            }
                        }
                        catch { }
                        try
                        {
                            LinkedInManager.linkedInDictionaryExcelInput.Add(objLinkedInMaster._Username, objLinkedInMaster);
                        }
                        catch { }
                    }
                }
                catch { }

            }
            Thread objloginthread = new Thread(StartScarpperLoginUsingThreadPool);
            objloginthread.Start();
        }
        private void InBoardProGetDataThread()
        {
            foreach (string[] itemArr in excelData)
            {
                try
                {
                    LinkedInMaster objLinkedInMaster = new LinkedInMaster();
                    try
                    {
                        if (!string.IsNullOrEmpty(itemArr[0]))
                        {
                            objLinkedInMaster._Postalcode = itemArr[0];
                        }
                    }
                    catch { }
                    try
                    {
                        if (!string.IsNullOrEmpty(itemArr[1]))
                        {
                            objLinkedInMaster._Distance = itemArr[1];
                        }
                    }
                    catch { }
                    try
                    {
                        if (!string.IsNullOrEmpty(itemArr[2]))
                        {
                            objLinkedInMaster._IndustryType = itemArr[2];
                        }

                    }
                    catch { }
                    try
                    {
                        if (!string.IsNullOrEmpty(itemArr[3]))
                        {
                            objLinkedInMaster._LastName = itemArr[3];
                        }
                    }
                    catch { }
                    try
                    {
                        if (!string.IsNullOrEmpty(itemArr[4]))
                        {
                            objLinkedInMaster._Username = itemArr[4];
                        }
                    }
                    catch { }
                    try
                    {
                        if (!string.IsNullOrEmpty(itemArr[5]))
                        {
                            objLinkedInMaster._Password = itemArr[5];
                        }
                    }
                    catch { }
                    try
                      {
                        objLinkedInMaster._ProxyAddress = itemArr[6];
                        if (!string.IsNullOrEmpty(itemArr[6]))
                        {
                            string[] words = itemArr[6].Split(new char[] { char.Parse(":") });
                            if (words.Count() > 1)
                            {
                                try
                                {
                                    string Portno = words[1];
                                    objLinkedInMaster._ProxyPort = Portno;
                                    objLinkedInMaster._ProxyAddress = words[0];// +":" + words[1] + ":" + words[2] + ":" + words[3];
                                }
                                catch { }
                            }
                            else
                            {
                                try
                                {
                                    objLinkedInMaster._ProxyAddress = words[0];//+ ":" + words[1] + ":" + words[2] + ":" + words[3];
                                }
                                catch { }

                            }
                        }
                        // string[] itemss=
                    }
                    catch { }
                    try
                    {
                        if (!string.IsNullOrEmpty(itemArr[7]))
                        {
                           // objLinkedInMaster._ProxyPassword = itemArr[7];
                            objLinkedInMaster._ProxyPort = itemArr[7];
                        }
                    }
                    catch { }
                    try
                    {
                        if (!string.IsNullOrEmpty(itemArr[8]))
                        {
                            objLinkedInMaster._ProxyUsername = itemArr[8];
                        }
                    }
                    catch
                    { }
                    try
                    {
                        if (!string.IsNullOrEmpty(itemArr[9]))
                        {
                            objLinkedInMaster._ProxyPassword = itemArr[9];
                        }
                    }
                    catch
                    { }
                    try
                    {
                        if (!string.IsNullOrEmpty(itemArr[0]) && !string.IsNullOrEmpty(itemArr[1]))
                        {
                            LinkedInManager.linkedInDictionaryExcelInput.Add(objLinkedInMaster._Username, objLinkedInMaster);
                        }
                        else
                        {
                            break;
                        }
                    }
                    catch { }
                }
                catch { }
            }
            Thread objloginthread = new Thread(StartLoginUsingThreadPool);
            objloginthread.Start();
        }
Example #11
0
        public void LoadGridView()
        {
            try
            {
                DataTable dt = objclsLinkedINAccount.SelectAccoutsForGridView();
                try
                {
                    dgvAccount.Invoke(new MethodInvoker(delegate
                    {
                        dgvAccount.DataSource = dt;

                    }));
                }
                catch { }

                //*** Add to Dictonary ***************************

                LinkedInManager.linkedInDictionary.Clear();

                try
                {
                    foreach (DataRow DTRow in dt.Rows)
                    {
                        try
                        {
                            LinkedInMaster objLinkedInMaster = new LinkedInMaster();
                            objLinkedInMaster._Username = DTRow[0].ToString();
                            objLinkedInMaster._Password = DTRow[1].ToString();
                            objLinkedInMaster._ProxyAddress = DTRow[2].ToString();
                            objLinkedInMaster._ProxyPort = DTRow[3].ToString();
                            objLinkedInMaster._ProxyUsername = DTRow[4].ToString();
                            objLinkedInMaster._ProxyPassword = DTRow[5].ToString();

                            LinkedInManager.linkedInDictionary.Add(objLinkedInMaster._Username, objLinkedInMaster);
                            //Ld_lstAccountCheckerEmail.Add(objLinkedInMaster._Username, objLinkedInMaster);
                            if (Globals.IsFreeVersion)
                            {
                                if (dt.Rows.Count >= 5)
                                {
                                    if (_accountcounter > 4)
                                    {
                                        FrmFreeTrial frmFreeTrial = new FrmFreeTrial();
                                        frmFreeTrial.TopMost = true;
                                        frmFreeTrial.ShowDialog();
                                        break;
                                    }
                                    else
                                    {
                                        _accountcounter++;
                                    }
                                }
                            }

                        }
                        catch (Exception ex)
                        {
                            Console.WriteLine(ex.Message);
                        }
                    }

                    //AddLoggerAccountLoad(LinkedInManager.linkedInDictionary.Count + " Accounts loaded");
                    ////AddLoggerAccounts(LinkedInManager.linkedInDictionary.Count + " Accounts loaded");
                    //Log(LinkedInManager.linkedInDictionary.Count + " Accounts loaded");
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                    AddLoggerAccountLoad("[ " + DateTime.Now + " ] => [ Account Loading has some problem in GridView ]");
                }

                try
                {
                    this.Invoke(new MethodInvoker(delegate
                    {
                        lblAccountStatus.Text = "PROCESS COMPLETED";
                    }));
                }
                catch
                {
                }

                try
                {
                    if (dt.Rows.Count > 0)
                    {
                        label6.Invoke(new MethodInvoker(delegate
                        {
                            label6.Text = dt.Rows.Count.ToString();
                        }));

                    }
                    else
                    {
                        label6.Invoke(new MethodInvoker(delegate
                        {
                            label6.Text = (0).ToString();
                        }));
                    }
                }
                catch
                {
                }
            }
            catch
            {
            }
        }
Example #12
0
        private void LoadDataGrid()
        {
            Ld_lstAccountCheckerEmail.Clear();
            try
            {
                DataTable dt = objclsLDAccount.SelectAccoutsForGridView();

                //ds = new DataSet();
                //ds.Tables.Add(dt);

                try
                {
                    this.Invoke(new MethodInvoker(delegate
                    {
                        lblAccountStatus.Text = "Process Running !";
                    }));
                }
                catch
                {
                }

                dgvAccount.Invoke(new MethodInvoker(delegate
                {
                    dgvAccount.DataSource = dt;
                }));

                Globals.listAccounts.Clear();
                LinkedInManager.linkedInDictionary.Clear();

                ///Add Twitter instances to TweetAccountContainer.dictionary_TweetAccount
                foreach (DataRow dRow in dt.Rows)
                {
                    try
                    {
                        LinkedInMaster LinkedIn = new LinkedInMaster();
                        LinkedIn._Username = dRow[0].ToString();
                        LinkedIn._Password = dRow[1].ToString();
                        LinkedIn._ProxyAddress = dRow[2].ToString();
                        LinkedIn._ProxyPort = dRow[3].ToString();
                        LinkedIn._ProxyUsername = dRow[4].ToString();
                        LinkedIn._ProxyPassword = dRow[5].ToString();

                        //if (!string.IsNullOrEmpty(dRow[7].ToString()))
                        //{
                        //    LinkedIn.profileStatus = int.Parse(dRow[7].ToString());
                        //}
                        //if (Globals.IsFreeVersion)
                        //{
                        //    if (dt.Rows.Count >= 5)
                        //    {
                        //        InBoardPro.FrmFreeTrial frmFreeTrial = new InBoardPro.FrmFreeTrial();
                        //        frmFreeTrial.TopMost = true;
                        //        frmFreeTrial.BringToFront();
                        //        frmFreeTrial.ShowDialog();
                        //        break;
                        //    }
                        //}

                        Globals.listAccounts.Add(LinkedIn._Username + ":" + LinkedIn._Password + ":" + LinkedIn._ProxyAddress + ":" + LinkedIn._ProxyPort + ":" + LinkedIn._ProxyUsername + ":" + LinkedIn._ProxyPassword);
                        LinkedInManager.linkedInDictionary.Add(LinkedIn._Username, LinkedIn);

                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }

                }

                Ld_lstAccountCheckerEmail.AddRange(Globals.listAccounts);

                try
                {
                    if (dt.Rows.Count > 0)
                    {
                        label6.Invoke(new MethodInvoker(delegate
                        {
                            label6.Text = dt.Rows.Count.ToString();
                        }));

                    }
                    else
                    {
                        label6.Invoke(new MethodInvoker(delegate
                        {
                            label6.Text = (0).ToString();
                        }));
                    }
                }
                catch
                {
                }

                Console.WriteLine(Globals.listAccounts.Count + " Accounts loaded");
                AddToListBox("[ " + DateTime.Now + " ] => [ " + Globals.listAccounts.Count + " Accounts loaded ]");
                Log("[ " + DateTime.Now + " ] => [ " + Globals.listAccounts.Count + " Accounts loaded ]");

                try
                {
                    this.Invoke(new MethodInvoker(delegate
                    {
                        lblAccountStatus.Text = "PROCESS COMPLETED";
                    }));
                }
                catch
                {
                }
            }
            catch { }

            //RaiseLoadAccountsEvent();
        }