예제 #1
0
        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);
                        }
                    }
                }
            }
        }
예제 #2
0
        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);
        }