Esempio n. 1
0
        private void LoginForAddExperience(object Parameter)
        {
            try
            {
                if (IsStopAddExperience)
                {
                    return;
                }

                if (!IsStopAddExperience)
                {
                    lstThreadforAddExperience.Add(Thread.CurrentThread);
                    lstThreadforAddExperience.Distinct();
                    Thread.CurrentThread.IsBackground = true;
                }

                string account = string.Empty;
                string post = string.Empty;
                Array paramsArray = new object[1];

                paramsArray = (Array)Parameter;

                KeyValuePair<string, LinkedInMaster> item = (KeyValuePair<string, LinkedInMaster>)paramsArray.GetValue(0);
                account = item.Key;
                GlobusHttpHelper HttpHelper = new GlobusHttpHelper();
                LinkedinLogin Login = new LinkedinLogin();

                Login.accountUser = item.Key;
                Login.accountPass = item.Value._Password;
                Login.proxyAddress = item.Value._ProxyAddress;
                Login.proxyPort = item.Value._ProxyPort;
                Login.proxyUserName = item.Value._ProxyUsername;
                Login.proxyPassword = item.Value._ProxyPassword;

                ProfileManager.ProfileManager objAddExperience = new ProfileManager.ProfileManager(Login.accountUser, Login.accountPass, Login.proxyAddress, Login.proxyPort, Login.proxyUserName, Login.proxyPassword);

                objAddExperience.LinkedInAddExperienceLogEvents.addToLogger += ScrapperRecordsLogEvents_addToLogger;
                Login.logger.addToLogger += new EventHandler(ScrapperRecordsLogEvents_addToLogger);

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

                try
                {
                    if (Login.IsLoggedIn)
                    {
                        AddExperienceLogger("[ " + DateTime.Now + " ] => [ Logged In With " + item.Key + " , Adding Experience ]");
                        objAddExperience.AddExperience(ref HttpHelper);
                    }
                }

                catch { }

                objAddExperience.LinkedInAddExperienceLogEvents.addToLogger -= ScrapperRecordsLogEvents_addToLogger;
                Login.logger.addToLogger -= new EventHandler(ScrapperRecordsLogEvents_addToLogger);
            }
            catch { }
            finally
            {
                 counter_ProcessComplete--;

                if (counter_ProcessComplete == 0)
                {
                    if (btnStartAddExperience.InvokeRequired)
                    {
                        btnStartAddExperience.Invoke(new MethodInvoker(delegate
                        {
                            AddExperienceLogger("[ " + DateTime.Now + " ] => [ PROCESS COMPLETED ]");
                            AddExperienceLogger("----------------------------------------------------------------------------------------------------------------------------");
                            btnStartAddExperience.Cursor = Cursors.Default;
                        }));
                    }
                }
            }
        }
Esempio n. 2
0
        public void startProfilingAfterAccountCreation(object oo)
        {
            ProfileManager.ProfileManager profileUpdater = new ProfileManager.ProfileManager();

            string postAuthenticityToken = string.Empty;
            string Email = string.Empty;
            string password = string.Empty;
            string p_Add = string.Empty;
            string p_port = string.Empty;
            string P_username = string.Empty;
            string p_pass = string.Empty;
            string profileUsername = string.Empty;
            string profileURL = string.Empty;
            string profileDescription = string.Empty;
            string profileLocation = string.Empty;
            string profilePic = string.Empty;


            Array ACProfileArr = (Array)oo;

            Email = (string)ACProfileArr.GetValue(0);
            password = (string)ACProfileArr.GetValue(1);
            p_Add = (string)ACProfileArr.GetValue(2);
            p_port = (string)ACProfileArr.GetValue(3);
            P_username = (string)ACProfileArr.GetValue(4);
            p_pass = (string)ACProfileArr.GetValue(5);
            postAuthenticityToken = (string)ACProfileArr.GetValue(6);
            GlobusHttpHelper globusHttpHelper = (GlobusHttpHelper)ACProfileArr.GetValue(7);


            //********Get location from Uploaded list...

            if (AC_IsUseLoaction)
            {
                if (count_profileLocation < _lstAcLocation.Count)
                {
                    profileLocation = _lstAcLocation[count_profileLocation];
                    count_profileLocation++;
                    //AddToListAccountsLogs(Email + " >>>> Location : " + profileLocation);
                }
                else
                {
                    count_profileLocation = 0;
                    profileLocation = _lstAcLocation[count_profileLocation];
                    //AddToListAccountsLogs(Email + " >>>> Location : " + profileLocation);
                }
            }


            // *******Get profile Usl From uploaded list ....!!

            if (AC_IsUseProfileURL)
            {
                if (count_profileURL < _lstAcProfileURL.Count)
                {
                    profileURL = _lstAcProfileURL[count_profileURL];
                    count_profileURL++;
                    //AddToListAccountsLogs(Email + " >>>> Url : " + profileURL);
                }
                else
                {
                    count_profileURL = 0;
                    profileURL = _lstAcProfileURL[count_profileURL];
                    //AddToListAccountsLogs(Email + " >>>> Url : " + profileURL);
                }
            }

            //***********Get discription from Uploaded List..!!

            if (AC_IsUseDescription)
            {
                if (count_profileDescription < _lstAcUseDescription.Count)
                {
                    profileDescription = _lstAcUseDescription[count_profileDescription];
                    count_profileDescription++;
                    //AddToListAccountsLogs(Email + " >>>> Description : " + profileDescription);
                }
                else
                {
                    count_profileDescription = 0;
                    profileDescription = _lstAcUseDescription[count_profileDescription];
                    //AddToListAccountsLogs(Email + " >>>> Description : " + profileDescription);
                }
            }



            //***********Get Profile image from Uploaded List..!!

            if (AC_IsUseProfileImage)
            {
                if (count_profilePic < _lstAcProfileImage.Count)
                {
                    profilePic = _lstAcProfileImage[count_profilePic];
                    count_profilePic++;
                    //AddToListAccountsLogs(Email + " >>>> Description : " + profileDescription);
                }
                else
                {
                    count_profilePic = 0;
                    profilePic = _lstAcProfileImage[count_profilePic];
                    //AddToListAccountsLogs(Email + " >>>> Description : " + profileDescription);
                }
            }




            //******Get change Details of Prodile ********

            try
            {
                Thread.Sleep(500);

                if (!string.IsNullOrEmpty(profileUsername) || !string.IsNullOrEmpty(profileLocation) || !string.IsNullOrEmpty(profileURL) || !string.IsNullOrEmpty(profileDescription) || !string.IsNullOrEmpty(profilePic))
                {
                    if (profileUpdater.UpdateProfile(profileUsername, profileLocation, profileURL, profileDescription, profilePic, postAuthenticityToken, ref globusHttpHelper))
                    {
                        Log("[ " + DateTime.Now + " ] => [ Profile Updated : " + Email + " ]");
                        GlobusFileHelper.AppendStringToTextfileNewLine(Email + ":" + password + ":" + p_Add + ":" + p_port + ":" + P_username + ":" + p_pass, Globals.path_SuccessfullyProfiledAccounts);
                    }
                    else
                    {
                        Log("[ " + DateTime.Now + " ] => [ Unable to Update Profile : " + Email + " ]");
                        GlobusFileHelper.AppendStringToTextfileNewLine(Email + ":" + password + ":" + p_Add + ":" + p_port + ":" + P_username + ":" + p_pass, Globals.path_FailedToProfileAccounts);
                    }
                }
            }
            catch (Exception)
            {
            }
        }
Esempio n. 3
0
        public void GetChangeHeaderImages(object Param)
        {
            try
            {
                /// Incremant of Thread counter ...
                Interlocked.Increment(ref _CountThreadChangeProfileHeaderImage);

                // get value from param
                Array _ParamValue = new object[2];
                _ParamValue = (Array)Param;

                KeyValuePair<string, TweetAccountManager> _KeyValue = (KeyValuePair<string, TweetAccountManager>)_ParamValue.GetValue(0);

                TweetAccountManager HeaderAccountManager = (TweetAccountManager)_KeyValue.Value;

                /// Get logging account
                HeaderAccountManager.Login();

                if (!HeaderAccountManager.IsLoggedIn)
                {
                    // Account is not loggedin
                    return;
                }
                if (!HeaderAccountManager.IsNotSuspended)
                {
                    // account is suspended..
                    return;
                }

                ///Add Data In Dictionary for stop processes.
                try
                {
                    dictionary_Threads.Add(Thread.CurrentThread.Name, Thread.CurrentThread);
                }
                catch { };

                ///create profile image object
                ///for calling related members ..!!
                ProfileManager.ProfileManager profilemanager = new ProfileManager.ProfileManager();
                profilemanager.logEvents.addToLogger += new EventHandler(logEvents_Profile_addToLogger);

                string imageFilePath = string.Empty;

                if (_IsChooseRandomImage)
                {
                    ///Get random image from image list box
                    int RandomNumber = RandomNumberGenerator.GenerateRandom(0, lst_HeaderImageFile.Count);
                    imageFilePath = lst_HeaderImageFile[RandomNumber];
                }
                else
                {
                    /// Get image file path from list
                    /// as according to account sequence .

                    int _Imageindex = 0;
                    if ((TweetAccountContainer.dictionary_TweetAccount.Count <= lst_HeaderImageFile.Count) && lst_HeaderImageFile.Count > 1)
                    {
                        _Imageindex = Array.IndexOf(TweetAccountContainer.dictionary_TweetAccount.Keys.ToArray(), HeaderAccountManager.Username);
                    }

                    imageFilePath = lst_HeaderImageFile[_Imageindex];
                }

                /// Call image change funtion from profile manager..
                bool IsSuccesFullyChanged = profilemanager.ImageUploadForProfileHeader(HeaderAccountManager.postAuthenticityToken, HeaderAccountManager.Screen_name, imageFilePath, ref HeaderAccountManager.globusHttpHelper);

                if (IsSuccesFullyChanged)
                {
                    AddToListProfile("[ " + DateTime.Now + " ] => [ Header image is changed to " + HeaderAccountManager.Username + " ]");

                    /// Write Details of account
                    /// shen header is changed
                    GlobusFileHelper.AppendStringToTextfileNewLine(HeaderAccountManager.Username + ":" + HeaderAccountManager.Password + ":" + imageFilePath, Globals.Path_SuccessfullyChangedHeaderImage);
                }
                else
                {
                    /// Log failed process
                    /// and write in text file ..
                    AddToListProfile("[ " + DateTime.Now + " ] => [ Header image is not changed to " + HeaderAccountManager.Username + " ]");
                    GlobusFileHelper.AppendStringToTextfileNewLine(HeaderAccountManager.Username + ":" + HeaderAccountManager.Password + ":" + imageFilePath, Globals.Path_FailedHeaderImageChanging);
                }
            }
            catch (Exception ex)
            {
                GlobusFileHelper.AppendStringToTextfileNewLine("Method :- GetChangeHeaderImages >>  Message :- " + ex.Message + "  >> Error :- " + ex.StackTrace, Globals.Path_ErrorLogForHeaderImage);
            }
            finally
            {
                /// Decremant of Thread counter ...
                Interlocked.Decrement(ref _CountThreadChangeProfileHeaderImage);
                lock (lockerThreadsChangeHeaderImage)
                {
                    Monitor.Pulse(lockerThreadsChangeHeaderImage);
                }
            }
        }
Esempio n. 4
0
        public void GetChangeAccountPass(Object Param)
        {
            try
            {
                accntPasswordThreadStart = true;
                Lst_accntPasswordThread.Add(Thread.CurrentThread);
                Lst_accntPasswordThread = Lst_accntPasswordThread.Distinct().ToList();

            }
            catch (Exception)
            {
            }
            try
            {
                Interlocked.Increment(ref _CountThreadChangeAcPass);
                // get value from param
                Array _ParamValue = new object[2];
                _ParamValue = (Array)Param;

                KeyValuePair<string, TweetAccountManager> _KeyValue = (KeyValuePair<string, TweetAccountManager>)_ParamValue.GetValue(0);

                TweetAccountManager AcManager = (TweetAccountManager)_KeyValue.Value;

                AcManager.Login();

                if (!AcManager.IsLoggedIn)
                {
                    // Account is not loggedin
                    return;
                }
                if (!AcManager.IsNotSuspended)
                {
                    // account is suspended..
                    return;
                }

                string _PassWord = string.Empty;
                if (_IsChooseRandomPassword)
                {
                    //Get random password from list
                    int _RendomePass = 0;
                    _RendomePass = (BaseLib.RandomNumberGenerator.GenerateRandom(0, lst_NewPassword.Count));
                    _PassWord = lst_NewPassword[_RendomePass];
                }
                else
                {
                    //get key index from dictionary
                    int _Passindex = 0;
                    if (TweetAccountContainer.dictionary_TweetAccount.Count >= lst_NewPassword.Count)
                    {
                        _Passindex = Array.IndexOf(TweetAccountContainer.dictionary_TweetAccount.Keys.ToArray(), AcManager.Username);

                    }
                    _PassWord = lst_NewPassword[_Passindex];
                }

                //Create profile manager class object and Call Method for postig values

                ProfileManager.ProfileManager Profilemanger = new ProfileManager.ProfileManager();
                Profilemanger.logEvents.addToLogger += new EventHandler(logEvents_addToAcManagerLogger);

                //StartAgain:
                bool _IsPassChanged = false;
                string message = string.Empty;

                _IsPassChanged = Profilemanger.UpdateAccountPass(AcManager.postAuthenticityToken, AcManager.Password, _PassWord, ref AcManager.globusHttpHelper, out message);

                if (_IsPassChanged)
                {
                    AddToLog_AcManager("[ " + DateTime.Now + " ] => [ " + AcManager.Username + ":- " + message + " ]");
                    //write new password in text file
                    string content = AcManager.Username + ":" + _PassWord;
                    Globussoft.GlobusFileHelper.AppendStringToTextfileNewLine(content, BaseLib.Globals.Path_SuccessFullyPasswordChange);
                }
                else
                {
                    AddToLog_AcManager("[ " + DateTime.Now + " ] => [ " + AcManager.Username + ":- " + message + " ]");
                    //Path_FailedChangingPass
                    string content = AcManager.Username + ":" + _PassWord;
                    Globussoft.GlobusFileHelper.AppendStringToTextfileNewLine(content, BaseLib.Globals.Path_SuccessFullyPasswordChange);
                    //goto StartAgain;
                }
            }
            catch (Exception)
            {
            }
            finally
            {
                Interlocked.Decrement(ref _CountThreadChangeAcPass);
                lock (lockerThreadsChangeAcPass)
                {
                    Monitor.Pulse(lockerThreadsChangeAcPass);
                }
            }
        }
Esempio n. 5
0
        public void GetChangeAccountDetails(Object Param)
        {
            try
            {
                accntManagerThreadStart = true;
                Lst_accntManagerThread.Add(Thread.CurrentThread);
                Lst_accntManagerThread = Lst_accntManagerThread.Distinct().ToList();
                //Thread.CurrentThread.IsBackground = true;
            }
            catch (Exception)
            {
            }
            try
            {
                ///Incease counter of thread ...

                Interlocked.Increment(ref _CountThreadAccountManagerForChAngeEmailOrScreenName);

                // get value from param
                Array _ParamValue = new object[2];
                _ParamValue = (Array)Param;

                KeyValuePair<string, TweetAccountManager> _KeyValue = (KeyValuePair<string, TweetAccountManager>)_ParamValue.GetValue(0);

                int StartDelay = (int)_ParamValue.GetValue(1);
                int EndDelay = (int)_ParamValue.GetValue(2);
                bool isChangeScreenName = (bool)_ParamValue.GetValue(3); ;
                bool isChangeEmail = (bool)_ParamValue.GetValue(4); ;

                TweetAccountManager AcManager = (TweetAccountManager)_KeyValue.Value;

                AcManager.Login();

                if (!AcManager.IsLoggedIn)
                {
                    // Account is not loggedin
                    return;
                }
                if (!AcManager.IsNotSuspended)
                {
                    // account is suspended..
                    return;
                }

                //Create profile manager class object and Call Method for postig values

                ProfileManager.ProfileManager Profilemanger = new ProfileManager.ProfileManager();

                Profilemanger.logEvents.addToLogger += new EventHandler(logEvents_addToAcManagerLogger);

                #region
                //if (_AcManagerSelectRandomValuesFromList)
                //{
                //    // get a rendome number for email and user name
                //    String _email = string.Empty;
                //    String _UserScreenName = string.Empty;

                //    int _RendomeNumberForUserName = 0;
                //    int _RendomeNumberForEmail = 0;

                //    if (lst_AcManagerEmail.Count != 0 && isChangeEmail)
                //    {
                //        // Get Values From list

                //        _RendomeNumberForEmail = (BaseLib.RandomNumberGenerator.GenerateRandom(0, lst_AcManagerEmail.Count));
                //        _email = lst_AcManagerEmail[_RendomeNumberForEmail];
                //    }

                //    if (lst_AcManagerUserName.Count != 0 && isChangeScreenName)
                //    {
                //        // Get Values From list

                //        _RendomeNumberForUserName = (BaseLib.RandomNumberGenerator.GenerateRandom(0, lst_AcManagerUserName.Count));
                //        _UserScreenName = lst_AcManagerUserName[_RendomeNumberForUserName];
                //    }

                //    try
                //    {
                //        //Profilemanger.UpdateProfileAccount(AcManager.postAuthenticityToken, _UserScreenName, _email, AcManager.Password, ref AcManager.globusHttpHelper);

                //        //call update account method for changing details of account..

                //        bool _IsPassChanged = false;

                //        _IsPassChanged = Profilemanger.UpdateProfileAccount(AcManager.postAuthenticityToken, _UserScreenName, _email, AcManager.Password, ref AcManager.globusHttpHelper);

                //        if (_IsPassChanged)
                //        {
                //            //Print in logger
                //            //Add In Text file
                //            string Content = _email + ":" + AcManager.Password + ":" + _UserScreenName;
                //            Globussoft.GlobusFileHelper.AppendStringToTextfileNewLine(Content, Globals.Path_SuccessFillyChangeUserAndEmail);
                //        }
                //        else
                //        {
                //            //Email Or user screen name changing failure
                //            string Content = AcManager.Username + ":" + AcManager.Password + ":" + _UserScreenName;
                //            Globussoft.GlobusFileHelper.AppendStringToTextfileNewLine(Content, Globals.Path_FailedChangingUserAndEmail);
                //        }

                //        ///get rendome Delay time ..
                //        int DelayTime = BaseLib.RandomNumberGenerator.GenerateRandom(StartDelay, EndDelay);
                //        AddToLog_AcManager("Delay For " + DelayTime);
                //        Thread.Sleep(DelayTime);

                //    }
                //    catch (Exception ex)
                //    {
                //        GlobusFileHelper.AppendStringToTextfileNewLine("Method :- GetChangeAccountDetails >>  Message :- " + ex.Message + "  >> Error :- " + ex.StackTrace, Globals.Path_ErrorLogForAccountManager);

                //    }

                //}
                //else
                //{
                //    int _CountUserName = 0;
                //    int _CountEmail = 0;
                //    //while (true)
                //    {
                //        String _email = string.Empty;
                //        String _UserScreenName = string.Empty;

                //        if (lst_AcManagerEmail.Count != 0)
                //        {
                //            _CountEmail = Array.IndexOf(TweetAccountContainer.dictionary_TweetAccount.Keys.ToArray(), AcManager.Username);

                //            if (lst_AcManagerEmail.Count >= _CountEmail)
                //            {
                //                _email = lst_AcManagerEmail[_CountEmail];
                //            }
                //            else
                //            {
                //                _email = lst_AcManagerEmail[0];
                //            }
                //        }

                //        if (lst_AcManagerEmail.Count != 0 && isChangeEmail)
                //        {

                //            _CountUserName = Array.IndexOf(TweetAccountContainer.dictionary_TweetAccount.Keys.ToArray(), AcManager.Username);

                //            if (lst_AcManagerUserName.Count >= _CountUserName)
                //            {
                //                _UserScreenName = lst_AcManagerUserName[_CountUserName];
                //            }
                //            else
                //            {
                //                _UserScreenName = lst_AcManagerUserName[0];
                //            }
                //        }

                //        try
                //        {
                //            //call update account method for changing details of account..

                //            bool _IsPassChanged = false;

                //            _IsPassChanged = Profilemanger.UpdateProfileAccount(AcManager.postAuthenticityToken, _UserScreenName, _email, AcManager.Password, ref AcManager.globusHttpHelper);

                //            if (_IsPassChanged)
                //            {
                //                //Print in logger
                //                //Add In Text file
                //                string Content = _email + ":" + AcManager.Password + ":" + _UserScreenName;
                //                Globussoft.GlobusFileHelper.AppendStringToTextfileNewLine(Content, Globals.Path_SuccessFillyChangeUserAndEmail);
                //            }
                //            else
                //            {
                //                //Email Or user screen name changing failure
                //                string Content = AcManager.Username + ":" + AcManager.Password + ":" + _UserScreenName;
                //                Globussoft.GlobusFileHelper.AppendStringToTextfileNewLine(Content, Globals.Path_FailedChangingUserAndEmail);
                //            }
                //        }
                //        catch (Exception ex)
                //        {
                //            GlobusFileHelper.AppendStringToTextfileNewLine("Method :- GetChangeAccountDetails >>  Message :- " + ex.Message + "  >> Error :- " + ex.StackTrace, Globals.Path_ErrorLogForAccountManager);

                //        }

                //        ///get rendome Delay time ..
                //        int DelayTime = BaseLib.RandomNumberGenerator.GenerateRandom(StartDelay, EndDelay);
                //        AddToLog_AcManager("Delay For " + DelayTime);
                //        Thread.Sleep(DelayTime);
                //    }
                //}
                #endregion

                //Initalize Variables for Email and Screen name ..
                String _email = string.Empty;
                String _UserScreenName = string.Empty;

                // get a rendome number for email and user name
                if (_AcManagerSelectRandomValuesFromList)
                {
                    int _RendomeNumberForUserName = 0;
                    int _RendomeNumberForEmail = 0;

                    if (lst_AcManagerEmail.Count != 0 && isChangeEmail)
                    {
                        // Get Values From list

                        _RendomeNumberForEmail = (BaseLib.RandomNumberGenerator.GenerateRandom(0, lst_AcManagerEmail.Count));
                        _email = lst_AcManagerEmail[_RendomeNumberForEmail];
                    }

                    if (lst_AcManagerUserName.Count != 0 && isChangeScreenName)
                    {
                        // Get Values From list

                        _RendomeNumberForUserName = (BaseLib.RandomNumberGenerator.GenerateRandom(0, lst_AcManagerUserName.Count));
                        _UserScreenName = lst_AcManagerUserName[_RendomeNumberForUserName];
                    }
                }
                else
                {
                    int _CountScreenName = 0;
                    int _CountEmail = 0;

                    if (lst_AcManagerEmail.Count != 0 && isChangeEmail)
                    {
                        _CountEmail = Array.IndexOf(TweetAccountContainer.dictionary_TweetAccount.Keys.ToArray(), AcManager.Username);

                        if (lst_AcManagerEmail.Count >= _CountEmail)
                        {
                            _email = lst_AcManagerEmail[_CountEmail];
                        }
                        else
                        {
                            _email = lst_AcManagerEmail[0];
                        }
                    }

                    if (lst_AcManagerUserName.Count != 0 && isChangeScreenName)
                    {

                        _CountScreenName = Array.IndexOf(TweetAccountContainer.dictionary_TweetAccount.Keys.ToArray(), AcManager.Username);

                        if (lst_AcManagerUserName.Count >= _CountScreenName)
                        {
                            _UserScreenName = lst_AcManagerUserName[_CountScreenName];
                        }
                        else
                        {
                            _UserScreenName = lst_AcManagerUserName[0];
                        }
                    }
                }

                try
                {

                    //call update account method for changing details of account..

                    bool Status = false;
                    string _Responce = string.Empty;

                    Status = Profilemanger.UpdateProfileAccount(AcManager.postAuthenticityToken, _UserScreenName, _email, AcManager.Password, ref AcManager.globusHttpHelper, out _Responce);

                    if (Status)
                    {

                        if (!string.IsNullOrEmpty(_UserScreenName) && chk_AcManagerUserName.Checked)
                        {
                            //Print in logger
                            //Add In Text file
                            AddToLog_AcManager("[" + DateTime.Now + " ] => [ " + _UserScreenName + "  has changed in :-" + AcManager.Username + " ]");
                            //string Content = _email + ":" + AcManager.Password + ":" + _UserScreenName;
                            Globussoft.GlobusFileHelper.AppendStringToTextfileNewLine(_UserScreenName, Globals.Path_SuccessFullyChangeUserName);
                            //Globussoft.GlobusFileHelper.AppendStringToTextfileNewLine(_email, Globals.Path_SuccessFillyChangeEmail);
                        }

                        if (!string.IsNullOrEmpty(_email) && chk_AcManagerEmail.Checked)
                        {
                            AddToLog_AcManager("[" + DateTime.Now + " ] => [ " + _email + "  has changed in :-" + AcManager.Username + " ]");
                            //string Content = _email + ":" + AcManager.Password + ":" + _UserScreenName;
                            Globussoft.GlobusFileHelper.AppendStringToTextfileNewLine(_email, Globals.Path_SuccessFullyChangeEmail);
                            //Globussoft.GlobusFileHelper.AppendStringToTextfileNewLine(Content, Globals.Path_SuccessFillyChangeUserAndEmail);
                        }
                    }
                    else
                    {
                        if (!string.IsNullOrEmpty(_UserScreenName) && chk_AcManagerUserName.Checked)
                        {
                            AddToLog_AcManager("[" + DateTime.Now + " ] => [ " + _UserScreenName + "  has not changed in :-" + AcManager.Username + " ]");
                        }
                        AddToLog_AcManager("[ " + DateTime.Now + " ] => [ " + _Responce + " From :- " + AcManager.Username + " ]");
                        //Email Or user screen name changing failure
                        string Content = AcManager.Username + ":" + AcManager.Password;
                        Globussoft.GlobusFileHelper.AppendStringToTextfileNewLine(Content, Globals.Path_FailedChangingUserAndEmail);
                    }

                    ///get rendome Delay time ..
                    int DelayTime = BaseLib.RandomNumberGenerator.GenerateRandom(StartDelay, EndDelay);
                    AddToLog_AcManager("[ " + DateTime.Now + " ] => [ Delay For " + DelayTime + "  sec]");
                    Thread.Sleep(DelayTime * 1000);
                    AddToLog_AcManager("[ " + DateTime.Now + " ]=> PROCESS COMPLETED.");

                }
                catch (Exception ex)
                {
                    GlobusFileHelper.AppendStringToTextfileNewLine("Method :- GetChangeAccountDetails >>  Message :- " + ex.Message + "  >> Error :- " + ex.StackTrace, Globals.Path_ErrorLogForAccountManager);

                }
                finally
                {
                    Profilemanger.logEvents.addToLogger -= new EventHandler(logEvents_addToAcManagerLogger);
                }
            }
            catch (Exception ex)
            {
                GlobusFileHelper.AppendStringToTextfileNewLine("Method :- GetChangeAccountDetails >>  Message :- " + ex.Message + "  >> Error :- " + ex.StackTrace, Globals.Path_ErrorLogForAccountManager);
            }
            finally
            {
                ///Decrement  counter of thread ...

                Interlocked.Decrement(ref _CountThreadAccountManagerForChAngeEmailOrScreenName);

                lock (locker_AccountManagerForChAngeEmailOrScreenName)
                {
                    Monitor.Pulse(locker_AccountManagerForChAngeEmailOrScreenName);
                }
            }
        }
Esempio n. 6
0
        private void LoginForAddExperience(object Parameter)
        {
            try
            {
                if (IsStopAddExperience)
                {
                    return;
                }

                if (!IsStopAddExperience)
                {
                    lstThreadforAddExperience.Add(Thread.CurrentThread);
                    lstThreadforAddExperience.Distinct();
                    Thread.CurrentThread.IsBackground = true;
                }

                string account     = string.Empty;
                string post        = string.Empty;
                Array  paramsArray = new object[1];

                paramsArray = (Array)Parameter;

                KeyValuePair <string, LinkedInMaster> item = (KeyValuePair <string, LinkedInMaster>)paramsArray.GetValue(0);
                account = item.Key;
                GlobusHttpHelper HttpHelper = new GlobusHttpHelper();
                LinkedinLogin    Login      = new LinkedinLogin();

                Login.accountUser   = item.Key;
                Login.accountPass   = item.Value._Password;
                Login.proxyAddress  = item.Value._ProxyAddress;
                Login.proxyPort     = item.Value._ProxyPort;
                Login.proxyUserName = item.Value._ProxyUsername;
                Login.proxyPassword = item.Value._ProxyPassword;

                ProfileManager.ProfileManager objAddExperience = new ProfileManager.ProfileManager(Login.accountUser, Login.accountPass, Login.proxyAddress, Login.proxyPort, Login.proxyUserName, Login.proxyPassword);

                objAddExperience.LinkedInAddExperienceLogEvents.addToLogger += ScrapperRecordsLogEvents_addToLogger;
                Login.logger.addToLogger += new EventHandler(ScrapperRecordsLogEvents_addToLogger);

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

                try
                {
                    if (Login.IsLoggedIn)
                    {
                        AddExperienceLogger("[ " + DateTime.Now + " ] => [ Logged In With " + item.Key + " , Adding Experience ]");
                        objAddExperience.AddExperience(ref HttpHelper);
                    }
                }

                catch { }

                objAddExperience.LinkedInAddExperienceLogEvents.addToLogger -= ScrapperRecordsLogEvents_addToLogger;
                Login.logger.addToLogger -= new EventHandler(ScrapperRecordsLogEvents_addToLogger);
            }
            catch { }
            finally
            {
                counter_ProcessComplete--;

                if (counter_ProcessComplete == 0)
                {
                    if (btnStartAddExperience.InvokeRequired)
                    {
                        btnStartAddExperience.Invoke(new MethodInvoker(delegate
                        {
                            AddExperienceLogger("[ " + DateTime.Now + " ] => [ PROCESS COMPLETED ]");
                            AddExperienceLogger("----------------------------------------------------------------------------------------------------------------------------");
                            btnStartAddExperience.Cursor = Cursors.Default;
                        }));
                    }
                }
            }
        }