コード例 #1
0
        public static void AddingLinkedInDataToCSVFile(string Data, string FileName)
        {
            try
            {
                string LinkedInAppData = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "LinkedInScraper\\" + FileName + ".csv");
                string LinkedInDeskTop = Globals.DesktopFolder + "\\LinkedInScraper" + FileName + ".csv";

                #region LinkedIn Writer
                if (!File.Exists(LinkedInAppData))
                {
                    string Header = "ProfileType" + "," + "UserProfileLink" + "," + "ProfileID" + "," + "FirstName" + "," + "LastName" + "," + "HeadLineTitle" + "," + "CurrentTitle" + "," + "Current Company" + "," + "Current Company Url" + "," + "Description of all Company" + "," + "Background - Summary" + "," + "Connection" + "," + "Recommendations " + "," + "SkillAndExpertise " + "," + "Experience " + "," + " Education" + "," + "Groups" + "," + "UserEmail" + "," + "UserContactNumber" + "," + "PastTitles" + "," + "PastCompany" + "," + "Location" + "," + "Country" + "," + "Industry" + "," + "WebSites" + "," + "LinkedInLoginID" + "," + "AccountType" + "," + "Email" + "," + "ProfilePhoneNumber" + "," + "CurrentComapnyName" + "," + "CompanyPhoneNumber" + ",";
                    GlobusFileHelper.AppendStringToTextfileNewLine(Header, LinkedInAppData);
                }

                //Checking File Exixtance
                if (!File.Exists(LinkedInDeskTop))
                {
                    string Header = "ProfileType" + "," + "UserProfileLink" + "," + "ProfileID" + "," + "FirstName" + "," + "LastName" + "," + "HeadLineTitle" + "," + "CurrentTitle" + "," + "Company" + "," + "Current Company Url" + "," + "Background - Summary" + "," + "Connection" + "," + "Recommendations " + "," + "SkillAndExpertise " + "," + "Experience " + "," + " Education" + "," + "Groups" + "," + "UserEmail" + "," + "UserContactNumber" + "," + "PastTitles" + "," + "PastCompany" + "," + "Location" + "," + "Country" + "," + "Industry" + "," + "WebSites" + "," + "LinkedInLoginID" + "," + "AccountType" + "," + "Email" + "," + "ProfilePhoneNumber" + "," + "CurrentComapnyName" + "," + "CompanyPhoneNumber" + ",";
                    GlobusFileHelper.AppendStringToTextfileNewLine(Header, LinkedInDeskTop);
                }

                if (!string.IsNullOrEmpty(Data))
                {
                    GlobusFileHelper.AppendStringToTextfileNewLine(Data, LinkedInDeskTop);
                }
                #endregion
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
コード例 #2
0
        public static void SalesNavigatorScraperWriteToCSV(string Data, string Header, string FileName)
        {
            try
            {
                string LinkedInAppData = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "LinkedInScraper\\" + FileName + ".csv");
                string LinkedInDeskTop = Globals.DesktopFolder + "\\" + FileName + ".csv";

                #region LinkedIn Writer
                if (!File.Exists(LinkedInAppData))
                {
                    GlobusFileHelper.AppendStringToTextfileNewLine(Header, LinkedInAppData);
                }

                //Checking File Exixtance
                if (!File.Exists(LinkedInDeskTop))
                {
                    GlobusFileHelper.AppendStringToTextfileNewLine(Header, LinkedInDeskTop);
                }

                if (!string.IsNullOrEmpty(Data))
                {
                    GlobusFileHelper.AppendStringToTextfileNewLine(Data, LinkedInDeskTop);
                }
                #endregion
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
コード例 #3
0
        public static void AddingLinkedInDataToCSVFileWithoutGoingToMainProfile(string Data, string FileName)
        {
            try
            {
                string LinkedInAppData = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "LinkedInScraper\\" + FileName + ".csv");
                string LinkedInDeskTop = Globals.DesktopFolder + "\\LinkedInScraper" + FileName + ".csv";

                #region LinkedIn Writer
                if (!File.Exists(LinkedInAppData))
                {
                    string Header = "ProfileUrl" + "," + "FirstName" + "," + "LastName" + "," + "HeadlineTitle" + "," + "Location" + "," + "Industry" + "," + "CurrentTitle" + "," + "PastTitle" + "," + "degreeOfConnection" + ",";
                    GlobusFileHelper.AppendStringToTextfileNewLine(Header, LinkedInAppData);
                }

                //Checking File Exixtance
                if (!File.Exists(LinkedInDeskTop))
                {
                    string Header = "ProfileUrl" + "," + "FirstName" + "," + "LastName" + "," + "HeadlineTitle" + "," + "Location" + "," + "Industry" + "," + "CurrentTitle" + "," + "PastTitle" + "," + "degreeOfConnection" + ",";
                    GlobusFileHelper.AppendStringToTextfileNewLine(Header, LinkedInDeskTop);
                }

                if (!string.IsNullOrEmpty(Data))
                {
                    GlobusFileHelper.AppendStringToTextfileNewLine(Data, LinkedInDeskTop);
                }
                #endregion
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
コード例 #4
0
ファイル: ErrorLogger.cs プロジェクト: thehrisworld/twtboard
 public static void AddToErrorLogText(string message)
 {
     try
     {
         GlobusFileHelper.AppendStringToTextfileNewLine(message, path_ErrorTextFile);
     }
     catch { }
 }
コード例 #5
0
 public static void AddLoggerFile(string Item)
 {
     try
     {
         GlobusFileHelper.AppendStringToTextfileNewLine(Item, FilePath.Path_LinkedinErrorLogs);
         GlobusFileHelper.AppendStringToTextfileNewLine(Item, Globals.DesktopFolder);
     }
     catch (Exception ex)
     {
     }
 }
コード例 #6
0
ファイル: FBLoginChecker.cs プロジェクト: kuggaa/gramboard
 /// <summary>
 /// Write Failed Accounts to FailedAccounts.txt on Desktop
 /// </summary>
 private void WriteToTextFile()
 {
     try
     {
         GlobusFileHelper.AppendStringToTextfileNewLine(Username + ":" + Password, failedAccountsFilePath);
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
     }
 }
コード例 #7
0
ファイル: ProxyCheker.cs プロジェクト: ondrocks/inboard
        public bool CheckProxy()
        {
            try
            {
                int    Working    = 0;
                string LoggedInIp = string.Empty;

                //BaseLib.ChilkatHttpHelpr HttpHelper = new BaseLib.ChilkatHttpHelpr();
                //string pageSource = HttpHelper.GetHtmlProxy("http://www.linkedin.com/", proxyAddress, proxyPort, proxyUsername, proxyPassword);

                GlobusHttpHelper HttpHelper = new GlobusHttpHelper();
                string           pageSource = HttpHelper.getHtmlfromUrlProxy(new Uri("http://www.linkedin.com/"), proxyAddress, int.Parse(proxyPort), proxyUsername, proxyPassword);

                if (string.IsNullOrEmpty(pageSource))//(string.IsNullOrEmpty(pageSource) && string.IsNullOrEmpty(PgSrcHome))
                {
                    Thread.Sleep(500);
                    pageSource = HttpHelper.getHtmlfromUrlProxy(new Uri("http://www.linkedin.com/"), proxyAddress, int.Parse(proxyPort), proxyUsername, proxyPassword);
                    if (string.IsNullOrEmpty(pageSource))
                    {
                        return(false);
                    }
                }
                ///Logic to check...
                if (pageSource.Contains("LinkedIn") && (pageSource.Contains("Sign Up")))
                {
                    try
                    {
                        using (SQLiteConnection con = new SQLiteConnection(DataBaseHandler.CONstr))
                        {
                            using (SQLiteDataAdapter ad = new SQLiteDataAdapter())
                            {
                                Working = 1;
                                string InsertQuery = "Insert into tb_Proxies values('" + proxyAddress + "','" + proxyPort + "','" + proxyUsername + "','" + proxyPassword + "', " + Working + "," + IsPublic + " , '" + LoggedInIp + "')";
                                DataBaseHandler.InsertQuery(InsertQuery, "tb_Proxies");
                                GlobusFileHelper.AppendStringToTextfileNewLine(proxyAddress + ":" + proxyPort + ":" + proxyUsername + ":" + proxyPassword, Globals.Path_ExsistingProxies);
                            }
                        }
                    }
                    catch { }

                    return(true);
                }

                return(false);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.StackTrace);
                return(false);
            }
        }
コード例 #8
0
        public static void ExportDataCSVFile(string CSV_Header, string CSV_Content, string CSV_FilePath)
        {
            try
            {
                if (!File.Exists(CSV_FilePath))
                {
                    GlobusFileHelper.AppendStringToTextFile(CSV_FilePath, CSV_Header);
                }

                GlobusFileHelper.AppendStringToTextFile(CSV_FilePath, CSV_Content);
            }
            catch (Exception)
            {
            }
        }
コード例 #9
0
        public static List <string> GetSpinnedListOneString(string inputstringMessage, char separator)
        {
            List <string> tempList  = new List <string>();
            List <string> inputList = new List <string>();

            tempList.Add(inputstringMessage);

            inputList.Clear();
            foreach (string item in tempList)
            {
                List <string> tempSpunList = GlobusFileHelper.GetSpinnedComments(item, separator);
                inputList.AddRange(tempSpunList);
            }

            return(inputList);
        }
コード例 #10
0
        public static List <string> GetSpinnedList(List <string> inputList)
        {
            List <string> tempList = new List <string>();

            foreach (string item in inputList)
            {
                tempList.Add(item);
            }
            inputList.Clear();
            foreach (string item in tempList)
            {
                List <string> tempSpunList = GlobusFileHelper.GetSpinnedComments(item);
                inputList.AddRange(tempSpunList);
            }
            return(inputList);
        }
コード例 #11
0
ファイル: FBAccountChecker.cs プロジェクト: kuggaa/gramboard
        public void CreateFileLikeDeskTop(string Content, string CheckData)
        {
            //string strPath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\\FaceDominatorLikeAccount";
            string strPath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\\FaceDominatorFbAccount";

            try
            {
                #region Commented
                //if (Directory.Exists(strPath))
                //{
                //    if (CheckLike=="Like")
                //    {
                //        GlobusFileHelper.AppendStringToTextfileNewLine(Content, strPath + "\\LikedFbAccount.txt");
                //    }
                //    if (CheckLike == "UnLike")
                //    {
                //        GlobusFileHelper.AppendStringToTextfileNewLine(Content, strPath + "\\UnLikedFbAccount.txt");
                //    }
                //}
                //else
                //{
                //    Directory.CreateDirectory(strPath);
                //    if (CheckLike == "Like")
                //    {
                //        GlobusFileHelper.AppendStringToTextfileNewLine(Content, strPath + "\\LikedFbAccount.txt");
                //    }
                //    if (CheckLike == "UnLike")
                //    {
                //        GlobusFileHelper.AppendStringToTextfileNewLine(Content, strPath + "\\UnLikedFbAccount.txt");
                //    }
                //}
                #endregion
                if (!Directory.Exists(strPath))
                {
                    Directory.CreateDirectory(strPath);
                }
                if (CheckData == "FriendProfileUrl")
                {
                    GlobusFileHelper.AppendStringToTextfileNewLine(Content, strPath + "\\FriendProfileUrl.txt");
                }
                else if (CheckData == "DisableFbAccount")
                {
                    GlobusFileHelper.AppendStringToTextfileNewLine(Content, strPath + "\\DisableFbAccount.txt");
                }
                else if (CheckData == "IncorrectFbAccount")
                {
                    GlobusFileHelper.AppendStringToTextfileNewLine(Content, strPath + "\\IncorrectFbAccount.txt");
                }
                else if (CheckData == "PhoneVerifyFbAccount")
                {
                    GlobusFileHelper.AppendStringToTextfileNewLine(Content, strPath + "\\PhoneVerifyFbAccount.txt");
                }
                else if (CheckData == "CorrectFbAccount")
                {
                    GlobusFileHelper.AppendStringToTextfileNewLine(Content, strPath + "\\CorrectFbAccount.txt");
                }
                else if (CheckData == "TemporarilyFbAccount")
                {
                    GlobusFileHelper.AppendStringToTextfileNewLine(Content, strPath + "\\TemporarilyFbAccount.txt");
                }
                else if (CheckData == "AccountNotConfirmed")
                {
                    GlobusFileHelper.AppendStringToTextfileNewLine(Content, strPath + "\\AccountNotConfirmed.txt");
                }
                else if (CheckData == "NotCorrectFbAccount")
                {
                    GlobusFileHelper.AppendStringToTextfileNewLine(Content, strPath + "\\NotCorrectFbAccount.txt");
                }
                //GlobusFileHelper.WriteListtoTextfile(listDisabledFbAccount, strPath + "\\DisableFbAccount.txt");
                //    GlobusFileHelper.WriteListtoTextfile(listIncorrectFbAccount, strPath + "\\IncorrectFbAccount.txt");
                //    GlobusFileHelper.WriteListtoTextfile(listPhoneVerifyFbAccount, strPath + "\\PhoneVerifyFbAccount.txt");
                //    GlobusFileHelper.WriteListtoTextfile(listCorrectFbAccount, strPath + "\\CorrectFbAccount.txt");
                //    GlobusFileHelper.WriteListtoTextfile(listTemporarilyFbAccount, strPath + "\\TemporarilyFbAccount.txt");
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
コード例 #12
0
ファイル: FBLoginChecker.cs プロジェクト: kuggaa/gramboard
        //public bool CheckLogin(string response, string username, string password)
        //{
        //    this.Username = username;
        //    this.Password = password;

        //    if (!string.IsNullOrEmpty(response))
        //    {
        //        if (response.ToLower().Contains("unusual login activity"))
        //        {
        //            Console.WriteLine("Unusual Login Activity: " + username);
        //            PumpMessage("Unusual Login Activity: " + username);
        //            return false;
        //        }
        //        if (response.ToLower().Contains("incorrect username"))
        //        {
        //            Console.WriteLine("Incorrect username: "******"Incorrect username: "******"Choose a verification method".ToLower()))
        //        {
        //            Console.WriteLine("Choose a verification method: " + username);
        //            PumpMessage("Choose a verification method: " + username);
        //            return false;
        //        }
        //        if (response.ToLower().Contains("not logged in".ToLower()))
        //        {
        //            Console.WriteLine("not logged in: " + username);
        //            PumpMessage("not logged in: " + username);
        //            return false;
        //        }
        //        if (response.Contains("Please log in to continue".ToLower()))
        //        {
        //            Console.WriteLine("Please log in to continue: " + username);
        //            PumpMessage("Please log in to continue: " + username);
        //            return false;
        //        }
        //        if (response.Contains("re-enter your password"))
        //        {
        //            Console.WriteLine("Wrong password for: " + username);
        //            PumpMessage("Wrong password for: " + username);
        //            return false;
        //        }
        //        if (response.Contains("Incorrect Email"))
        //        {
        //            Console.WriteLine("Incorrect email: " + username);
        //            PumpMessage("Incorrect email: " + username);
        //            return false;
        //        }
        //        if (response.Contains("have been blocked"))
        //        {
        //            Console.WriteLine("you have been blocked: " + username);
        //            PumpMessage("you have been blocked: " + username);
        //            return false;
        //        }
        //        if (response.Contains("account has been disabled"))
        //        {
        //            Console.WriteLine("your account has been disabled: " + username);
        //            PumpMessage("your account has been disabled: " + username);
        //            return false;
        //        }
        //        if (response.Contains("Please complete a security check"))
        //        {
        //            Console.WriteLine("Please complete a security check: " + username);
        //            PumpMessage("Use a phone to verify your account : " + username);
        //            InsertUpdateDatabase(AccountStatus.Status(ProfileStatus.AccountCreated));
        //            return false;
        //        }
        //        if (response.Contains("Please complete a security check"))
        //        {
        //            Console.WriteLine("You must log in to see this page: " + username);
        //            PumpMessage("required phone verification : " + username);
        //            return false;
        //        }
        //        if (response.Contains("Your account is temporarily locked"))
        //        {
        //            Console.WriteLine("Your account is temporarily locked: " + username);
        //            PumpMessage("your account has been disabled: " + username);
        //            return false;
        //        }
        //        if (response.Contains("You must log in to see this page"))
        //        {
        //            Console.WriteLine("You must log in to see this page: " + username);
        //            PumpMessage("You must log in to see this page: " + username);
        //            return false;
        //        }
        //        if (response.Contains("Suspicious activity has been detected on your Facebook account"))
        //        {
        //            Console.WriteLine("Suspicious activity: " + username);
        //            PumpMessage("Suspicious activity: " + username);
        //            return false;
        //        }

        //    }
        //    else
        //    {
        //        return false;
        //    }
        //    return true;
        //}
        #endregion


        /// <summary>
        /// Checks if account is valid
        /// </summary>
        public bool CheckLogin(string response, string username, string password, string proxyAddress, string proxyPort, string proxyUsername, string proxyPassword)
        {
            this.Username = username;
            this.Password = password;

            this.proxyAddress  = proxyAddress;
            this.proxyPort     = proxyPort;
            this.proxyUsername = proxyUsername;
            this.proxyPassword = proxyPassword;

            if (!string.IsNullOrEmpty(response))
            {
                if (response.ToLower().Contains("unusual login activity"))
                {
                    Console.WriteLine("Unusual Login Activity: " + username);
                    PumpMessage("Unusual Login Activity: " + username);
                    return(false);
                }
                if (response.ToLower().Contains("incorrect username"))
                {
                    Console.WriteLine("Incorrect username: "******"Incorrect username: "******"Choose a verification method".ToLower()))
                {
                    Console.WriteLine("Choose a verification method: " + username);
                    PumpMessage("Choose a verification method: " + username);
                    return(false);
                }
                if (response.ToLower().Contains("not logged in".ToLower()))
                {
                    Console.WriteLine("not logged in: " + username);
                    PumpMessage("not logged in: " + username);
                    return(false);
                }
                if (response.Contains("Please log in to continue".ToLower()))
                {
                    Console.WriteLine("Please log in to continue: " + username);
                    PumpMessage("Please log in to continue: " + username);
                    return(false);
                }
                if (response.Contains("re-enter your password"))
                {
                    Console.WriteLine("Wrong password for: " + username);
                    PumpMessage("Wrong password for: " + username);
                    return(false);
                }
                if (response.Contains("Incorrect Email"))
                {
                    Console.WriteLine("Incorrect email: " + username);

                    try
                    {
                        ///Write Incorrect Emails in text file
                        GlobusFileHelper.AppendStringToTextfileNewLine(username + ":" + password, incorrectEmailFilePath);
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.Message);
                    }

                    InsertUpdateDatabase(AccountStatus.Status(ProfileStatus.IncorrectEmail));
                    PumpMessage("Incorrect email: " + username);
                    return(false);
                }
                if (response.Contains("have been blocked"))
                {
                    Console.WriteLine("you have been blocked: " + username);
                    WriteToTextFile();
                    InsertUpdateDatabase(AccountStatus.Status(ProfileStatus.AccountDisabled));
                    PumpMessage("you have been blocked: " + username);
                    return(false);
                }
                if (response.Contains("account has been disabled"))
                {
                    Console.WriteLine("your account has been disabled: " + username);
                    WriteToTextFile();
                    InsertUpdateDatabase(AccountStatus.Status(ProfileStatus.AccountDisabled));
                    PumpMessage("your account has been disabled: " + username);
                    return(false);
                }
                if (response.Contains("Please complete a security check"))
                {
                    Console.WriteLine("Please complete a security check: " + username);
                    PumpMessage("Use a phone to verify your account : " + username);
                    InsertUpdateDatabase(AccountStatus.Status(ProfileStatus.AccountCreated));
                    return(false);
                }
                if (response.Contains("Please complete a security check"))
                {
                    Console.WriteLine("You must log in to see this page: " + username);
                    InsertUpdateDatabase(AccountStatus.Status(ProfileStatus.AccountCreated));
                    PumpMessage("required phone verification : " + username);
                    return(false);
                }
                if (response.Contains("<input value=\"Sign Up\" onclick=\"RegistrationBootloader.bootloadAndValidate();"))
                {
                    Console.WriteLine("Not logged in with: " + username);
                    //InsertUpdateDatabase(AccountStatus.Status(ProfileStatus.AccountCreated));
                    PumpMessage("Not logged in with: " + username);
                    return(false);
                }
                if (response.Contains("Account Not Confirmed"))
                {
                    Console.WriteLine("Account Not Confirmed " + Username);
                    PumpMessage("Account Not Confirmed " + Username);
                    return(false);
                }
                if (response.Contains("Your account is temporarily locked"))
                {
                    Console.WriteLine("Your account is temporarily locked: " + username);
                    WriteToTextFile();
                    PumpMessage("your account has been disabled: " + username);
                    return(false);
                }
                if (response.Contains("You must log in to see this page"))
                {
                    Console.WriteLine("You must log in to see this page: " + username);
                    WriteToTextFile();
                    PumpMessage("You must log in to see this page: " + username);
                    return(false);
                }
                if (response.Contains("Suspicious activity has been detected on your Facebook account"))
                {
                    Console.WriteLine("Suspicious activity: " + username);
                    WriteToTextFile();
                    PumpMessage("Suspicious activity: " + username);
                    return(false);
                }
            }
            else
            {
                return(false);
            }
            return(true);
        }
コード例 #13
0
        private bool LoginAccount(string Username, string Password, string proxyAddress, string proxyPort, string proxyUserName, string proxyPassword)
        {
            bool   IsLoggedIn     = false;
            string _Username      = string.Empty;
            string _Password      = string.Empty;
            string _ProxyAddress  = string.Empty;
            string _ProxyPort     = string.Empty;
            string _ProxyUsername = string.Empty;
            string _ProxyPassword = string.Empty;

            try
            {
                _Username      = Username;
                _Password      = Password;
                _ProxyAddress  = proxyAddress;
                _ProxyPort     = proxyPort;
                _ProxyUsername = proxyUserName;
                _ProxyPassword = proxyPassword;

                if (string.IsNullOrEmpty(proxyPort) && !NumberHelper.ValidateNumber(proxyPort))
                {
                    _ProxyPort = "80";
                }

                Log("[ " + DateTime.Now + " ] => [ Logging in with : " + _Username + " ]");


                string Url = "https://www.linkedin.com/";

                string pageSrcLogin = HttpHelper.getHtmlfromUrlProxy(new Uri(Url), _ProxyAddress, Convert.ToInt32(_ProxyPort), _ProxyUsername, _ProxyPassword);


                string postdata     = string.Empty;
                string postUrl      = string.Empty;
                string ResLogin     = string.Empty;
                string csrfToken    = string.Empty;
                string sourceAlias  = string.Empty;
                string regCsrfParam = string.Empty;

                if (pageSrcLogin.Contains("csrfToken"))
                {
                    try
                    {
                        int    startIndex = pageSrcLogin.IndexOf("name=\"csrfToken\"");
                        string start      = pageSrcLogin.Substring(startIndex).Replace("name=\"csrfToken\"", "");
                        int    endIndex   = start.IndexOf("\" ");
                        string end        = start.Substring(0, endIndex).Replace("value=\"", "").Trim();
                        csrfToken = end;
                        csrfToken = csrfToken.Replace("ajax:", "");
                    }
                    catch (Exception ex)
                    {
                    }
                }

                try
                {
                    if (csrfToken.Contains("&"))
                    {
                        string[] Arr = csrfToken.Split('&');
                        csrfToken = Arr[0].Replace("\"", string.Empty);
                    }
                }
                catch { }

                SearchCriteria.CsrToken = csrfToken;
                if (pageSrcLogin.Contains("sourceAlias"))
                {
                    try
                    {
                        sourceAlias = pageSrcLogin.Substring(pageSrcLogin.IndexOf("sourceAlias"), 100);
                        string[] Arr = sourceAlias.Split('"');
                        sourceAlias = Arr[2].Replace("\\", string.Empty);
                    }
                    catch { }
                }

                try
                {
                    int SourceAliasStart = pageSrcLogin.IndexOf("regCsrfParam");
                    if (SourceAliasStart > 0)
                    {
                        try
                        {
                            regCsrfParam = pageSrcLogin.Substring(pageSrcLogin.IndexOf("regCsrfParam"), 100);
                            string[] Arr = regCsrfParam.Split('"');
                            regCsrfParam = Arr[2].Replace(@"\", string.Empty).Replace("//", string.Empty);
                        }
                        catch
                        {
                        }
                    }
                }
                catch { }


                //postUrl = "https://www.linkedin.com/uas/login-submit";
                //postdata = "session_key=" + Uri.EscapeDataString(_Username) + "&session_password="******"&source_app=&trk=guest_home_login&session_redirect=&csrfToken=" + csrfToken + "&sourceAlias=" + sourceAlias;
                //ResLogin = HttpHelper.postFormData(new Uri(postUrl), postdata);

                postUrl  = "https://www.linkedin.com/uas/login-submit";
                postdata = "isJsEnabled=true&source_app=&tryCount=&session_key=" + Uri.EscapeDataString(_Username) + "&session_password="******"&signin=Sign%20In&session_redirect=&loginCsrfParam=" + regCsrfParam + "&csrfToken=" + csrfToken + "&sourceAlias=" + sourceAlias;

                try
                {
                    ResLogin = HttpHelper.postFormDataProxy(new Uri(postUrl), postdata, _ProxyPassword, Convert.ToInt32(_ProxyPort), _ProxyUsername, _ProxyPassword);//HttpHelper.postFormDataRef(new Uri(postUrl), postdata, "http://www.linkedin.com/uas/login?goback=&trk=hb_signin", "", "");
                }
                catch { }


                if (ResLogin.Contains("Your LinkedIn account has been temporarily restricted") || ResLogin.Contains("Change your password") || ResLogin.Contains("Please confirm your email address"))
                {
                    if (ResLogin.Contains("Your LinkedIn account has been temporarily restricted"))
                    {
                        try
                        {
                            Log("[ " + DateTime.Now + " ] => [ Your LinkedIn account has been temporarily restricted : " + _Username + " ]");

                            GlobusFileHelper.AppendStringToTextfileNewLine(_Username, Globals.Path_TemporarilyRestrictedAccount_AccountChecker);
                        }
                        catch
                        {
                        }
                    }
                    if (ResLogin.Contains("Change your password"))
                    {
                        try
                        {
                            Log("[ " + DateTime.Now + " ] => [ Change your password : "******" ]");

                            GlobusFileHelper.AppendStringToTextfileNewLine(_Username, Globals.Path_ChangeYourPassword_AccountChecker);
                        }
                        catch
                        {
                        }
                    }
                    if (ResLogin.Contains("Please confirm your email address"))
                    {
                        try
                        {
                            Log("[ " + DateTime.Now + " ] => [ Please confirm your email address : " + _Username + " ]");

                            GlobusFileHelper.AppendStringToTextfileNewLine(_Username, Globals.Path_ConfirmYourEmailAddress_AccountChecker);
                        }
                        catch
                        {
                        }
                    }
                }

                if (ResLogin.Contains("The email address or password you provided does not match our records"))
                {
                    try
                    {
                        Log("[ " + DateTime.Now + " ] => [ The email address or password you provided does not match our records : " + _Username + " ]");

                        GlobusFileHelper.AppendStringToTextfileNewLine(_Username, Globals.Path_EmailAddressOrPasswordDoesNotMatch_AccountChecker);
                    }
                    catch
                    {
                    }
                }

                if (ResLogin.Contains("Security Verification"))
                {
                    try
                    {
                        Log("[ " + DateTime.Now + " ] => [ Security Verification : " + _Username + " ]");

                        GlobusFileHelper.AppendStringToTextfileNewLine(_Username, Globals.Path_SecurityVerification_AccountChecker);
                    }
                    catch
                    {
                    }
                }

                if (ResLogin.Contains("One or more of your email addresses needs confirmation"))
                {
                    try
                    {
                        Log("[ " + DateTime.Now + " ] => [ One or more of your email addresses needs confirmation : " + _Username + " ]");

                        GlobusFileHelper.AppendStringToTextfileNewLine(_Username, Globals.Path_ConfirmYourEmailAddress_AccountChecker);
                    }
                    catch
                    {
                    }
                }

                if (ResLogin.Contains("Sign Out") && !ResLogin.Contains("Your LinkedIn account has been temporarily restricted") && !ResLogin.Contains("Please confirm your email address"))
                {
                    IsLoggedIn = true;
                }

                string CheckedAccount = _Username + ":" + _Password;

                if (IsLoggedIn)
                {
                    try
                    {
                        Log("[ " + DateTime.Now + " ] => [ Successfully Logged In with : " + _Username + " ]");
                        GlobusFileHelper.AppendStringToTextfileNewLine(CheckedAccount, Globals.Path_WorkingAccount_AccountChecker);
                    }
                    catch
                    {
                    }
                }
                else
                {
                    try
                    {
                        Log("[ " + DateTime.Now + " ] => [ Failed to Login with : " + _Username + " ]");
                        GlobusFileHelper.AppendStringToTextfileNewLine(CheckedAccount, Globals.Path_NonWorkingAccount_AccountChecker);
                    }
                    catch
                    {
                    }
                }
            }
            catch (Exception ex)
            {
                GlobusFileHelper.AppendStringToTextfileNewLine("Module Name >>> AccountChecker, UserName >>> " + _Email + " , ex.Message >>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace + " , ex.StackTrace >>> " + ex.StackTrace + "  , Date Time >>> " + DateTime.Now, Globals.Path_ErrorFile_AccountChecker);
            }

            return(IsLoggedIn);
        }
コード例 #14
0
        private void CheckEmail(string Username, string Password, string proxyAddress, string proxyPort, string proxyUserName, string proxyPassword)
        {
            string _Username = string.Empty;

            try
            {
                string _Password      = string.Empty;
                string _ProxyAddress  = string.Empty;
                string _ProxyPort     = string.Empty;
                string _ProxyUsername = string.Empty;
                string _ProxyPassword = string.Empty;

                _Username      = Username;
                _Password      = Password;
                _ProxyAddress  = proxyAddress;
                _ProxyPort     = proxyPort;
                _ProxyUsername = proxyUserName;
                _ProxyPassword = proxyPassword;

                if (_Username.Length < 1)
                {
                    return;
                }

                Log("[ " + DateTime.Now + " ] => [ Starting To Check Email With UserName : "******" ]");

                if (string.IsNullOrEmpty(proxyPort) && !NumberHelper.ValidateNumber(proxyPort))
                {
                    _ProxyPort = "80";
                }

                string Url          = "https://www.linkedin.com/";
                string pageSrcLogin = HttpHelper.getHtmlfromUrlProxy(new Uri(Url), _ProxyAddress, Convert.ToInt32(_ProxyPort), _ProxyUsername, _ProxyPassword);

                string postdata    = string.Empty;
                string postUrl     = string.Empty;
                string ResLogin    = string.Empty;
                string csrfToken   = string.Empty;
                string sourceAlias = string.Empty;

                if (pageSrcLogin.Contains("csrfToken"))
                {
                    try
                    {
                        csrfToken = pageSrcLogin.Substring(pageSrcLogin.IndexOf("csrfToken"), 100);
                        string[] Arr = csrfToken.Split('"');
                        csrfToken = Arr[2].Replace("\\", string.Empty);
                    }
                    catch
                    {
                        try
                        {
                            csrfToken = pageSrcLogin.Substring(pageSrcLogin.IndexOf("csrfToken"), 100);
                            if (csrfToken.Contains("&"))
                            {
                                string[] Arr = csrfToken.Split('&');
                                csrfToken = Arr[0].Replace("\\", string.Empty).Replace("csrfToken=", string.Empty);
                            }
                            else if (csrfToken.Contains(","))
                            {
                                string[] Arr = csrfToken.Split(',');
                                csrfToken = Arr[0].Replace("\\", string.Empty);
                            }
                        }
                        catch { }
                    }
                }
                SearchCriteria.CsrToken = csrfToken;
                if (pageSrcLogin.Contains("sourceAlias"))
                {
                    try
                    {
                        sourceAlias = pageSrcLogin.Substring(pageSrcLogin.IndexOf("sourceAlias"), 100);
                        string[] Arr = sourceAlias.Split('"');
                        sourceAlias = Arr[2].Replace("\\", string.Empty);
                    }
                    catch { }
                }

                string getReqForCheckEmail = HttpHelper.getHtmlfromUrl1(new Uri("https://www.linkedin.com/uas/request-password-reset?session_redirect="));
                postUrl = "https://www.linkedin.com/uas/request-password-reset-submit";

                postdata = "email=" + Uri.EscapeDataString(_Username) + "&request=Submit+Address&sessionRedirect=&csrfToken=" + csrfToken + "&sourceAlias=" + sourceAlias + "";
                ResLogin = HttpHelper.postFormData(new Uri(postUrl), postdata);

                if (ResLogin.Contains("We couldn't find a LinkedIn account associated with " + _Username))
                {
                    try
                    {
                        Log("[ " + DateTime.Now + " ] => [ We couldn't find a LinkedIn account associated with " + _Username + " ]");
                        GlobusFileHelper.AppendStringToTextfileNewLine(_Username, Globals.Path_NonExistingEmail_EmailChecker);
                    }
                    catch
                    {
                    }
                }

                else if (ResLogin.Contains("Please check your email"))
                {
                    try
                    {
                        Log("[ " + DateTime.Now + " ] => [ Please check your email with : " + _Username + " ]");
                        GlobusFileHelper.AppendStringToTextfileNewLine(_Username, Globals.Path_ExistingEmail_EmailChecker);
                    }
                    catch
                    {
                    }
                }
                else if (ResLogin.Contains("Security Verification"))
                {
                    try
                    {
                        Log("[ " + DateTime.Now + " ] => [ Security Verification : " + _Username + " ]");

                        GlobusFileHelper.AppendStringToTextfileNewLine(_Username, Globals.Path_SecurityVerification_EmailChecker);
                    }
                    catch
                    {
                    }
                }
                else
                {
                    Log("[ " + DateTime.Now + " ] => [ There is some problem with : " + _Username + " ]");
                    GlobusFileHelper.AppendStringToTextfileNewLine(_Username, Globals.Path_OtherProblem_EmailChecker);
                }
            }
            catch (Exception ex)
            {
                GlobusFileHelper.AppendStringToTextfileNewLine("Module Name >>> EmailChecker, UserName >>> " + _Username + " , ex.Message >>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace + " , ex.StackTrace >>> " + ex.StackTrace + "  , Date Time >>> " + DateTime.Now, Globals.Path_ErrorFile_EmailChecker);
            }

            Log("[ " + DateTime.Now + " ] => [ PROCESS COMPLETED With UserName : "******" ]");
        }
コード例 #15
0
ファイル: LinkedInMaster.cs プロジェクト: ninjanody/inboard
        public string DecodeDBC(string[] args, byte[] imageBytes)
        {
            try
            {
                // Put your DBC username & password here:
                DeathByCaptcha.Client client = (DeathByCaptcha.Client) new DeathByCaptcha.SocketClient(args[0], args[1]);
                client.Verbose = true;

                Console.WriteLine("Your balance is {0:F2} US cents", client.Balance);//Log("Your balance is " + client.Balance + " US cents ");

                if (!client.User.LoggedIn)
                {
                    Log("[ " + DateTime.Now + " ] => [ Please check your DBC Account Details ]");
                    return(null);
                }
                if (client.Balance == 0.0)
                {
                    Log("[ " + DateTime.Now + " ] => [ You have 0 Balance in your DBC Account ]");
                    return(null);
                }

                for (int i = 2, l = args.Length; i < l; i++)
                {
                    Console.WriteLine("Solving CAPTCHA {0}", args[i]);

                    // Upload a CAPTCHA and poll for its status.  Put the CAPTCHA image
                    // file name, file object, stream, or a vector of bytes, and desired
                    // solving timeout (in seconds) here:
                    DeathByCaptcha.Captcha captcha = client.Decode(imageBytes, 2 * DeathByCaptcha.Client.DefaultTimeout);
                    if (null != captcha)
                    {
                        Console.WriteLine("CAPTCHA {0:D} solved: {1}", captcha.Id, captcha.Text);

                        //// Report an incorrectly solved CAPTCHA.
                        //// Make sure the CAPTCHA was in fact incorrectly solved, do not
                        //// just report it at random, or you might be banned as abuser.
                        //if (client.Report(captcha))
                        //{
                        //    Console.WriteLine("Reported as incorrectly solved");
                        //}
                        //else
                        //{
                        //    Console.WriteLine("Failed reporting as incorrectly solved");
                        //}

                        return(captcha.Text);
                    }
                    else
                    {
                        Log("[ " + DateTime.Now + " ] => [ CAPTCHA was not solved ]");
                        Console.WriteLine("CAPTCHA was not solved");
                        return(null);
                    }
                }
            }
            catch (Exception ex)
            {
                GlobusFileHelper.AppendStringToTextfileNewLine(DateTime.Now + " --> Error --> TwitterSignup -  SignupMultiThreaded() -- DecodeDBC()  --> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs);
                GlobusFileHelper.AppendStringToTextfileNewLine("Error --> TwitterSignup -  DecodeDBC() >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace + " || DateTime :- " + DateTime.Now, Globals.Path_LinkedinAccountCraetionErrorLogs);
            }
            return(null);
        }
コード例 #16
0
ファイル: LinkedInMaster.cs プロジェクト: ninjanody/inboard
        public void LoginHttpHelper(ref GlobusHttpHelper HttpHelper)
        {
            try
            {
                Log("[ " + DateTime.Now + " ] => [ Logging In With : " + _Username + " ]");
                Log("[ " + DateTime.Now + " ] => [ Login Process is Running... ]");

                //Check Login
                if (IsLoggedIn)
                {
                    try
                    {
                        string homePage = HttpHelper.getHtmlfromUrlProxy(new Uri("http://www.linkedin.com/home"), _ProxyAddress, int.Parse(_ProxyPort), _ProxyUsername, _ProxyPassword);

                        if (homePage.Contains("Sign Out") && homePage.Contains("class=\"signout\"") && !homePage.Contains("Your LinkedIn account has been temporarily restricted"))
                        {
                            Log("[ " + DateTime.Now + " ] => [ Already Logged In With : " + _Username + " ]");
                            return;
                        }
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }
                }


                string Url = "https://www.linkedin.com/";
                ////string pageSrcLogin = HttpChilkat.GetHtmlProxy(Url, proxyAddress, proxyPort, proxyUserName, proxyPassword);
                string pageSrcLogin = HttpHelper.getHtmlfromUrlProxy(new Uri(Url), _ProxyAddress, int.Parse(_ProxyPort), _ProxyUsername, _ProxyPassword);

                if (string.IsNullOrEmpty(pageSrcLogin))
                {
                    try
                    {
                        System.Threading.Thread.Sleep(1000);
                        pageSrcLogin = HttpHelper.getHtmlfromUrlProxy(new Uri(Url), _ProxyAddress, int.Parse(_ProxyPort), _ProxyUsername, _ProxyPassword, "");
                    }
                    catch
                    {
                    }
                }
                if (string.IsNullOrEmpty(pageSrcLogin))
                {
                    Log("[ " + DateTime.Now + " ] => [ Couldn't Login In With : " + _Username + " ]");
                    return;
                }

                string postdata     = string.Empty;
                string postUrl      = string.Empty;
                string ResLogin     = string.Empty;
                string csrfToken    = string.Empty;
                string sourceAlias  = string.Empty;
                string regCsrfParam = string.Empty;

                if (pageSrcLogin.Contains("csrfToken"))
                {
                    try
                    {
                        int startindex = pageSrcLogin.IndexOf("name=\"csrfToken\"");
                        if (startindex > 0)
                        {
                            string start    = pageSrcLogin.Substring(startindex).Replace("name=\"csrfToken\"", "");
                            int    endindex = start.IndexOf("\" ");
                            string end      = start.Substring(0, endindex);
                            csrfToken = end.Replace("value=\"", "").Replace("\\", "").Replace(" ", "");
                            //csrfToken = Uri.EscapeDataString(csrfToken);
                            if (csrfToken.Contains("https://www.linkedin.com"))
                            {
                                csrfToken = Utils.getBetween("@@@@@@@" + csrfToken, "@@@@@@@", "\"/></form>");
                            }
                        }
                        else
                        {
                            string[] Arr = csrfToken.Split('"');
                            csrfToken = Arr[2].Replace("\\", string.Empty);
                        }
                    }
                    catch
                    {
                        try
                        {
                            csrfToken = pageSrcLogin.Substring(pageSrcLogin.IndexOf("csrfToken"), 100);
                            if (csrfToken.Contains("&"))
                            {
                                string[] Arr = csrfToken.Split('&');
                                csrfToken = Arr[0];
                            }
                            else if (csrfToken.Contains(","))
                            {
                                string[] Arr = csrfToken.Split(',');
                                csrfToken = Arr[0].Replace("\\", string.Empty);
                            }
                            else
                            {
                                string[] Arr = csrfToken.Split(',');
                                csrfToken = Arr[0].Replace("\\", string.Empty).Replace("csrfToken=", "").Replace("\n", "").Replace("\">", "");
                            }
                        }
                        catch { }
                    }
                }

                try
                {
                    if (csrfToken.Contains("&"))
                    {
                        string[] Arr1 = csrfToken.Split('&');
                        csrfToken = Arr1[0].Replace("\"", string.Empty);
                    }
                }
                catch { }

                SearchCriteria.CsrToken = csrfToken.Replace("\n", "").Replace("//", "").Replace("\">", "").Replace("csrfToken=", "");


                if (pageSrcLogin.Contains("sourceAlias"))
                {
                    try
                    {
                        sourceAlias = pageSrcLogin.Substring(pageSrcLogin.IndexOf("sourceAlias"), 100);
                        string[] Arr = sourceAlias.Split('"');
                        sourceAlias = Arr[2].Replace("\\", string.Empty);
                    }
                    catch { }
                }

                try
                {
                    int SourceAliasStart = pageSrcLogin.IndexOf("regCsrfParam");
                    if (SourceAliasStart > 0)
                    {
                        try
                        {
                            regCsrfParam = pageSrcLogin.Substring(pageSrcLogin.IndexOf("regCsrfParam"), 100);
                            string[] Arr = regCsrfParam.Split('"');
                            regCsrfParam = Arr[2].Replace(@"\", string.Empty).Replace("//", string.Empty);
                        }
                        catch
                        {
                        }
                    }
                    if (string.IsNullOrEmpty(regCsrfParam))
                    {
                        regCsrfParam = Utils.getBetween(pageSrcLogin, "loginCsrfParam", "/>");
                        regCsrfParam = Utils.getBetween(regCsrfParam, "value=\"", "\"");
                    }
                }
                catch { }


                postUrl = "https://www.linkedin.com/uas/login-submit";
                //postdata = "isJsEnabled=true&source_app=&tryCount=&session_key=" + Uri.EscapeDataString(_Username) + "&session_password="******"&signin=Sign%20In&session_redirect=&loginCsrfParam=" + regCsrfParam + "&csrfToken=" + csrfToken + "&sourceAlias=" + sourceAlias;

                postdata = "isJsEnabled=true&source_app=&tryCount=&clickedSuggestion=false&session_key=" + Uri.EscapeDataString(_Username) + "&session_password="******"&signin=Sign%20In&session_redirect=&trk=hb_signin&loginCsrfParam=" + regCsrfParam + "&fromEmail=&csrfToken=" + csrfToken + "&sourceAlias=" + sourceAlias;
                // postdata = "isJsEnabled=true&source_app=&session_key=" + Uri.EscapeDataString(_Username) + "&session_password="******"&signin=Sign+In&session_redirect=&trk=&loginCsrfParam=7462d247-6d54-47de-8f22-29723ea15f9d&csrfToken=" + csrfToken + "&sourceAlias=" + sourceAlias;
                try
                {
                    ResLogin = HttpHelper.postFormDataProxy(new Uri(postUrl), postdata, _ProxyAddress, int.Parse(_ProxyPort), _ProxyUsername, _ProxyPassword);//HttpHelper.postFormDataRef(new Uri(postUrl), postdata, "http://www.linkedin.com/uas/login?goback=&trk=hb_signin", "", "");
                }
                catch { }


                //postUrl = "https://www.linkedin.com/uas/login-submit";
                //isJsEnabled=true&source_app=&tryCount=&session_key=gargimishra%40globussoft.com&session_password=globussoft&signin=Sign%20In&session_redirect=&csrfToken=ajax%3A7066152446927176852&sourceAlias=0_7r5yezRXCiA_H0CRD8sf6DhOjTKUNps5xGTqeX8EEoi
                //postdata = "isJsEnabled=true&source_app=&session_key=" + Uri.EscapeDataString(_Username) + "&session_password="******"&signin=Sign%20In&session_redirect=&csrfToken=" + csrfToken + "&sourceAlias=" + sourceAlias;
                // postdata = "session_key=" + Uri.EscapeDataString(_Username) + "&session_password="******"&source_app=&trk=guest_home_login&session_redirect=&csrfToken=" + csrfToken + "&sourceAlias=" + sourceAlias;

                //ResLogin = HttpHelper.postFormDataRef(new Uri(postUrl), postdata, "https://www.linkedin.com/uas/login?goback=&trk=hb_signin", "true", "");
                string dts = string.Empty;
                string captchachallengeid = string.Empty;
                string origActionAlias    = string.Empty;
                string origSourceAlias    = string.Empty;
                string irhf        = string.Empty;
                string captchaText = string.Empty;
                string ImageUrl    = string.Empty;
                //
                if (ResLogin.Contains("Your LinkedIn account has been temporarily restricted") || ResLogin.Contains("Change your password") || ResLogin.Contains("Please confirm your email address") && !ResLogin.Contains("Sign Out"))
                {
                    SearchCriteria.loginREsponce = ResLogin;
                }
                else if (ResLogin.Contains("Security Verification"))
                {
                    string dataforcapctha = HttpHelper.getHtmlfromUrl1(new Uri("https://www.google.com/recaptcha/api/noscript?k=6LcnacMSAAAAADoIuYvLUHSNLXdgUcq-jjqjBo5n"));
                    if (!string.IsNullOrEmpty(dataforcapctha))
                    {
                        int startindex = dataforcapctha.IndexOf("id=\"recaptcha_challenge_field\"");
                        if (startindex > 0)
                        {
                            string start    = dataforcapctha.Substring(startindex).Replace("id=\"recaptcha_challenge_field\"", "");
                            int    endindex = start.IndexOf("\">");
                            string end      = start.Substring(0, endindex).Replace("value=", "").Replace("\"", "");
                            ImageUrl = "https://www.google.com/recaptcha/api/image?c=" + end;
                            WebClient webclient = new WebClient();
                            byte[]    args      = webclient.DownloadData(ImageUrl);
                            string[]  arr1      = new string[] { Globals.CapchaLoginID, Globals.CapchaLoginPassword, "" };
                            captchaText = DecodeDBC(arr1, args);
                        }

                        if (ResLogin.Contains("name=\"security-challenge-id\""))
                        {
                            int startindexnew = ResLogin.IndexOf("name=\"security-challenge-id\"");
                            if (startindexnew > 0)
                            {
                                string start    = ResLogin.Substring(startindexnew).Replace("name=\"security-challenge-id\"", "").Replace("value=\"", "");
                                int    endindex = start.IndexOf("\"");
                                string end      = start.Substring(0, endindex);
                                captchachallengeid = end.Replace("\"", "");
                            }
                        }

                        if (ResLogin.Contains("name=\"dts\""))
                        {
                            int startindexnew = ResLogin.IndexOf("name=\"dts\"");
                            if (startindexnew > 0)
                            {
                                string start    = ResLogin.Substring(startindexnew).Replace("name=\"dts\"", "").Replace("value=\"", "");
                                int    endindex = start.IndexOf("\"");
                                string end      = start.Substring(0, endindex);
                                dts = end.Replace("\"", "");
                            }
                        }

                        if (ResLogin.Contains("name=\"origActionAlias\""))
                        {
                            int startindexnew = ResLogin.IndexOf("name=\"origActionAlias\"");
                            if (startindexnew > 0)
                            {
                                string start    = ResLogin.Substring(startindexnew).Replace("name=\"origActionAlias\"", "").Replace("value=\"", "");
                                int    endindex = start.IndexOf("\"");
                                string end      = start.Substring(0, endindex);
                                origActionAlias = end.Replace("\"", "");
                            }
                        }

                        if (ResLogin.Contains("name=\"origSourceAlias\""))
                        {
                            int startindexnew = ResLogin.IndexOf("name=\"origSourceAlias\"");
                            if (startindexnew > 0)
                            {
                                string start    = ResLogin.Substring(startindexnew).Replace("name=\"origSourceAlias\"", "").Replace("value=\"", "");
                                int    endindex = start.IndexOf("\"");
                                string end      = start.Substring(0, endindex);
                                origSourceAlias = end.Replace("\"", "");
                            }
                        }

                        if (ResLogin.Contains("name=\"irhf\""))
                        {
                            int startindexnew = ResLogin.IndexOf("name=\"irhf\"");
                            if (startindexnew > 0)
                            {
                                string start    = ResLogin.Substring(startindexnew).Replace("name=\"irhf\"", "").Replace("value=\"", "");
                                int    endindex = start.IndexOf("\"");
                                string end      = start.Substring(0, endindex);
                                irhf = end.Replace("\"", "");
                            }
                        }

                        //postdata = "dts=" + dts + "&security-challenge-id=" + captchachallengeid + "&hr=&source_app=&csrfToken=" + csrfToken + "&trk=guest_home&isJsEnabled=true&session_redirect=&session_password="******"&session_key=" + _Username + "&origSourceAlias=" + origSourceAlias + "&origActionAlias=" + origActionAlias + "&irhf=" + irhf +"&sourceAlias=" + sourceAlias;
                        if (!string.IsNullOrEmpty(ImageUrl) && !string.IsNullOrEmpty(captchaText))
                        {
                            postdata = "recaptcha_challenge_field=" + ImageUrl.Replace("https://www.google.com/recaptcha/api/image?c=", "") + "&recaptcha_response_field=" + captchaText.Replace(" ", "+") + "&dts=" + dts + "&security-challenge-id=" + captchachallengeid + "&hr=&source_app=&csrfToken=" + csrfToken + "&isJsEnabled=true&session_redirect=&session_password="******"&session_key=" + Uri.EscapeDataString(_Username) + "&origSourceAlias=" + origSourceAlias + "&origActionAlias=" + origActionAlias + "&irhf=" + irhf + "&sourceAlias=" + sourceAlias;
                            postdata = postdata.Replace(" ", "");
                            ResLogin = HttpHelper.postFormDataRef(new Uri("https://www.linkedin.com/uas/captcha-submit"), postdata, "https://www.linkedin.com/uas/login-submit", "", "", "", "", "");
                        }
                        else
                        {
                            ResLogin = "";
                        }

                        if (ResLogin.Contains("The text you entered does not match the characters in the security image. Please try again with this new image") || string.IsNullOrEmpty(ResLogin))
                        {
                            Log("[ " + DateTime.Now + " ] => [ " + _Username + " Cannot Login because of Capctcha ]");
                            GlobusFileHelper.WriteStringToTextfile(_Username + ":" + _Password + ":" + _ProxyAddress + ":" + _ProxyPort + ":" + _ProxyUsername + ":" + _ProxyPassword, Globals.pathCapcthaLogin);
                            SearchCriteria.loginREsponce = string.Empty;
                        }
                    }
                }

                //ResLogin.Contains("Sign Out") && ResLogin.Contains("class=\"signout\"") && !ResLogin.Contains("Your LinkedIn account has been temporarily restricted")
                if (ResLogin.Contains("Sign Out") && !ResLogin.Contains("Your LinkedIn account has been temporarily restricted"))
                {
                    SearchCriteria.loginREsponce = string.Empty;
                    IsLoggedIn = true;
                    string Search = HttpHelper.getHtmlfromUrl1(new Uri("http://www.linkedin.com/search?trk=advsrch"));
                    SearchCriteria.loginREsponce = Search;
                }
                else if (ResLogin.Contains("logout?session_full_logout"))
                {
                    SearchCriteria.loginREsponce = string.Empty;
                    IsLoggedIn = true;
                    string Search = HttpHelper.getHtmlfromUrl1(new Uri("http://www.linkedin.com/search?trk=advsrch"));
                    SearchCriteria.loginREsponce = Search;
                }
                else
                {
                    //There was an unexpected problem that prevented us from completing your request.
                    SearchCriteria.loginREsponce = string.Empty;
                    IsLoggedIn = false;
                }


                //Url = "http://www.linkedin.com/home?trk=hb_tab_home_top";
                //pageSrcLogin = HttpHelper.getHtmlfromUrlProxy(new Uri(Url), proxyAddress, 888, proxyUserName, proxyPassword);

                //LogoutHttpHelper(ref HttpHelper);

                //Url = "http://www.linkedin.com/home?trk=hb_tab_home_top";
                //pageSrcLogin = HttpHelper.getHtmlfromUrlProxy(new Uri(Url), proxyAddress, 888, proxyUserName, proxyPassword);
            }
            catch { }
        }
コード例 #17
0
        /// <summary>
        /// Assigns "accountsPerProxy" number of proxies to accounts in Database, only picks up only those accounts where ProxyAddress is Null or Empty
        /// </summary>
        #region AssignProxiesToAccounts
        public void AssignProxiesToAccounts(List <string> lstProxies, int noOfAccountsPerProxy)
        {
            try
            {
                DataSet ds = new DataSet();

                if (noOfAccountsPerProxy > 0)
                {
                    accountsPerProxy = noOfAccountsPerProxy;
                }
                else
                {
                    MessageBox.Show("You entered invalid Accounts per Proxy... Default value \"10\" Set");
                }

                using (SQLiteConnection con = new SQLiteConnection(DataBaseHandler.CONstr))
                {
                    foreach (string item in lstProxies)
                    {
                        try
                        {
                            ds.Clear();

                            string account = item;

                            string proxyAddress  = string.Empty;
                            string proxyPort     = string.Empty;
                            string proxyUserName = string.Empty;
                            string proxyPassword = string.Empty;

                            int DataCount = account.Split(':').Length;

                            if (DataCount == 2)
                            {
                                proxyAddress = account.Split(':')[0];
                                proxyPort    = account.Split(':')[1];
                            }
                            else if (DataCount > 2)
                            {
                                proxyAddress  = account.Split(':')[0];
                                proxyPort     = account.Split(':')[1];
                                proxyUserName = account.Split(':')[2];
                                proxyPassword = account.Split(':')[3];
                            }

                            //using (SQLiteDataAdapter ad = new SQLiteDataAdapter("SELECT * FROM tb_FBAccount WHERE ProxyAddress = '" + proxyAddress + "'", con))
                            using (SQLiteDataAdapter ad = new SQLiteDataAdapter("SELECT * FROM tb_LinkedInAccount WHERE IPAddress = '" + proxyAddress + "' and IPPort = '" + proxyPort + "'", con))
                            {
                                ad.Fill(ds);
                                if (ds.Tables[0].Rows.Count == 0)
                                {
                                    ds.Clear();
                                    using (SQLiteDataAdapter ad1 = new SQLiteDataAdapter("SELECT * FROM tb_LinkedInAccount WHERE IPAddress = '" + "" + "' OR IPAddress = '" + null + "'", con))
                                    {
                                        ad1.Fill(ds);

                                        int count = accountsPerProxy;  //Set count = accountsPerProxy so that it sets max this number of accounts to each proxy
                                        if (ds.Tables[0].Rows.Count < count)
                                        {
                                            count = ds.Tables[0].Rows.Count;
                                        }
                                        for (int i = 0; i < count; i++)
                                        {
                                            string UpdateQuery = "Update tb_LinkedInAccount Set IPAddress='" + proxyAddress + "', IPPort='" + proxyPort + "', IPUserName='******', IPPassword='******' WHERE UserName='******'";
                                            DataBaseHandler.UpdateQuery(UpdateQuery, "tb_LinkedInAccount");
                                        }
                                    }
                                }
                            }
                        }
                        catch
                        {
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                GlobusFileHelper.AppendStringToTextfileNewLine(DateTime.Now + " --> Error --> ProxyUtillitesFromDB -- AssignProxiesToAccounts() --> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_ProxySettingErroLog);
                GlobusFileHelper.AppendStringToTextfileNewLine("Error --> ProxyUtillitesFromDB -- AssignProxiesToAccounts() --> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs);
            }
        }