public void Login()
        {
            #region Test Code
            //            List<string> Accounts = new List<string>();

            //            Accounts.Add("[email protected]:password777");
            //Accounts.Add("[email protected]:password777");
            //Accounts.Add("[email protected]:password777");
            //Accounts.Add("[email protected]:password777");
            //Accounts.Add("[email protected]:password777");
            //Accounts.Add("[email protected]:password777");
            //Accounts.Add("[email protected]:password777");
            //Accounts.Add("[email protected]:password777");
            //Accounts.Add("[email protected]:password777");
            //Accounts.Add("[email protected]:password777");

            //foreach (string item in Accounts)
            //{

            //    string[] items = item.Split(':');

            //    string username = items[0];
            //    string password = items[1];

            //    Globussoft.GlobusHttpHelper HttpHelper1 = new Globussoft.GlobusHttpHelper();

            //   string ts = GenerateTimeStamp();

            //    string a = HttpHelper1.getHtmlfromUrlProxy(new Uri("http://twitter.com/"), "173.208.131.234", 8888, "usproxy", "logic");

            //    string a2 = HttpHelper1.getHtmlfromUrl(new Uri("http://twitter.com/account/bootstrap_data?r=0.21632839148912897"), "http://twitter.com/", string.Empty);

            //    string PostData = "session%5Busername_or_email%[email protected]&session%5Bpassword%5D=password777&scribe_log=%5B%22%7B%5C%22event_name%5C%22%3A%5C%22web%3Afront%3Alogin_callout%3Aform%3A%3Alogin_click%5C%22%2C%5C%22noob_level%5C%22%3Anull%2C%5C%22internal_referer%5C%22%3Anull%2C%5C%22user_id%5C%22%3A0%2C%5C%22page%5C%22%3A%5C%22front%5C%22%2C%5C%22_category_%5C%22%3A%5C%22client_event%5C%22%2C%5C%22ts%5C%22%3A" + ts + "%7D%22%5D&redirect_after_login="******"https://twitter.com/sessions?phx=1"), PostData, "http://twitter.com/", string.Empty);
            //    string response_Login = HttpHelper1.getHtmlfromUrl(new Uri("https://twitter.com/"), "", "");

            //}

            //Globussoft1.GlobusHttpHelper HttpHelper1 = new Globussoft1.GlobusHttpHelper();

            //ChilkatHttpHelpr chilkatHttpHelpr = new ChilkatHttpHelpr();

            //string ts = GenerateTimeStamp();

            //string a = chilkatHttpHelpr.GetHtmlProxy("http://twitter.com/", "", "", "neshkito", "7809062345");//HttpHelper1.getHtmlfromUrl(new Uri("http://twitter.com/"), string.Empty, string.Empty);

            ////string a1 = HttpHelper1.getHtmlfromUrl(new Uri("http://scribe.twitter.com/scribe?category=client_event&log=%7B%22context%22%3A%22front%22%2C%22event_name%22%3A%22web%3Afront%3A%3A%3Aimpression%22%7D&ts=1330691303089"),"http://twitter.com/", string.Empty);

            //string a2 = chilkatHttpHelpr.GetHtml("http://twitter.com/account/bootstrap_data?r=0.21632839148912897");//HttpHelper1.getHtmlfromUrl(new Uri("http://twitter.com/account/bootstrap_data?r=0.21632839148912897"), "http://twitter.com/", string.Empty);

            //Username = Uri.EscapeDataString("luanapinheirolp");

            //string PostData = "session%5Busername_or_email%5D=" + Username + "&session%5Bpassword%5D=password777&scribe_log=%5B%22%7B%5C%22event_name%5C%22%3A%5C%22web%3Afront%3Alogin_callout%3Aform%3A%3Alogin_click%5C%22%2C%5C%22noob_level%5C%22%3Anull%2C%5C%22internal_referer%5C%22%3Anull%2C%5C%22user_id%5C%22%3A0%2C%5C%22page%5C%22%3A%5C%22front%5C%22%2C%5C%22_category_%5C%22%3A%5C%22client_event%5C%22%2C%5C%22ts%5C%22%3A" + ts + "%7D%22%5D&redirect_after_login="******"https://twitter.com/sessions?phx=1", PostData, "http://twitter.com/");//HttpHelper1.postFormData(new Uri("https://twitter.com/sessions?phx=1"), PostData, "http://twitter.com/", string.Empty);

            //string test = string.Empty;

            //string a1 = chilkatHttpHelpr.GetHtml("http://twitter.com/");

            //Log("Logging in with " + Username);

            //GlobusHttpHelper globusHttpHelper1 = new GlobusHttpHelper();
            #endregion

            try
            {
                Log("[ " + DateTime.Now + " ] => [ Logging in with Account: " + Username + " ]");

                //Thread.Sleep(20000);
                //Password = Password.Replace("?", "%3F").Replace("&", "%26");
                string ts = GenerateTimeStamp();
                string get_twitter_first = string.Empty;
                try
                {
                   // get_twitter_first = globusHttpHelper.getHtmlfromUrl(new Uri(""), "", "");
                    get_twitter_first = globusHttpHelper.getHtmlfromUrlProxy(new Uri("https://twitter.com/"), proxyAddress, proxyPort, proxyUsername, proxyPassword, string.Empty, string.Empty,string.Empty);
                }
                catch (Exception ex)
                {
                    //string get_twitter_first = globusHttpHelper1.getHtmlfromUrlp(new Uri("http://twitter.com/"), string.Empty, string.Empty);
                    Thread.Sleep(1000);
                    get_twitter_first = globusHttpHelper.getHtmlfromUrlProxy(new Uri("https://twitter.com/"), proxyAddress, proxyPort, proxyUsername, proxyPassword, string.Empty, string.Empty);
                }

                try
                {
                    postAuthenticityToken = PostAuthenticityToken(get_twitter_first, "postAuthenticityToken");
                }
                catch { }
                try
                {

                    //string get_twitter_second = globusHttpHelper.postFormData(new Uri("https://twitter.com/scribe"), "log%5B%5D=%7B%22event_name%22%3A%22web%3Amobile_gallery%3Agallery%3A%3A%3Aimpression%22%2C%22noob_level%22%3Anull%2C%22internal_referer%22%3Anull%2C%22context%22%3A%22mobile_gallery%22%2C%22event_info%22%3A%22mobile_app_download%22%2C%22user_id%22%3A0%2C%22page%22%3A%22mobile_gallery%22%2C%22_category_%22%3A%22client_event%22%2C%22ts%22%3A" + ts + "%7D", "https://twitter.com/?lang=en&logged_out=1#!/download", "", "", "", "");//globusHttpHelper.getHtmlfromUrl(new Uri("https://twitter.com/account/bootstrap_data?r=0.21632839148912897"), "https://twitter.com/", string.Empty);

                    //string get2nd = globusHttpHelper.getHtmlfromUrlProxy(new Uri("http://twitter.com/account/bootstrap_data?r=0.21632839148912897"), "https://twitter.com/", proxyAddress, proxyPort, proxyUsername, proxyPassword);

                    //string get_api = globusHttpHelper.getHtmlfromUrl(new Uri("http://api.twitter.com/receiver.html"), "https://twitter.com/", "");

                }
                catch { }
                string postData = "session%5Busername_or_email%5D=" + Uri.EscapeDataString(Username) + "&session%5Bpassword%5D=" + Uri.EscapeDataString(Password) + "&authenticity_token=" + postAuthenticityToken + "&scribe_log=&redirect_after_login=&authenticity_token=" + postAuthenticityToken + "&remember_me=1";

                string response_Login = globusHttpHelper.postFormData(new Uri("https://twitter.com/sessions"), postData, "https://twitter.com/", proxyAddress, proxyPort, proxyUsername, proxyPassword);

                //response_Login = GlobusFileHelper.ReadStringFromTextfile("C:/Users/GLB-111/Desktop/new.txt");
                if (response_Login.Contains("अपनी पहचान सत्यापित करें") || response_Login.Contains("आपके खाते को सुरक्षित रखेने में हमें मदद करें.") || response_Login.Contains("Help us keep your account safe.") || response_Login.Contains("Verify your identity") || response_Login.Contains("account/login_challenge?"))
                {
                    try
                    {
                        string temp_user_id = string.Empty;
                        string challenge_id = string.Empty;
                        challenge_id = response_Login.Substring(response_Login.IndexOf("name=\"challenge_id\" value="), (response_Login.IndexOf("/>", response_Login.IndexOf("name=\"challenge_id\" value=")) - response_Login.IndexOf("name=\"challenge_id\" value="))).Replace("name=\"challenge_id\" value=", string.Empty).Replace("\"", "").Trim();
                        temp_user_id = response_Login.Substring(response_Login.IndexOf("name=\"user_id\" value="), (response_Login.IndexOf("/>", response_Login.IndexOf("name=\"user_id\" value=")) - response_Login.IndexOf("name=\"user_id\" value="))).Replace("name=\"user_id\" value=", string.Empty).Replace("\"", "").Trim();
                        if (response_Login.Contains(" name=\"challenge_type\" value=\"RetypeEmail") && response_Login.Contains("@"))
                        {
                            postData = "authenticity_token=" + postAuthenticityToken + "&challenge_id=" + challenge_id + "&user_id=" + temp_user_id + "&challenge_type=RetypeEmail&platform=web&redirect_after_login=&remember_me=true&challenge_response=" + Screen_name;
                            response_Login = globusHttpHelper.postFormData(new Uri("https://twitter.com/account/login_challenge"), postData, "https://twitter.com/account/login_challenge?platform=web&user_id=" + temp_user_id + "&challenge_type=RetypeEmail&remember_me=true", proxyAddress, proxyPort, proxyUsername, proxyPassword);
                        }
                        else
                        {
                            postData = "authenticity_token=" + postAuthenticityToken + "&challenge_id=" + challenge_id + "&user_id=" + temp_user_id + "&challenge_type=RetypeScreenName&platform=web&redirect_after_login=&remember_me=true&challenge_response=" + Screen_name;
                            response_Login = globusHttpHelper.postFormData(new Uri("https://twitter.com/account/login_challenge"), postData, "https://twitter.com/account/login_challenge?platform=web&user_id=" + temp_user_id + "&challenge_type=RetypeScreenName&remember_me=true", proxyAddress, proxyPort, proxyUsername, proxyPassword);

                        }
                    }
                    catch { }
                }

                string homePage = globusHttpHelper.getHtmlfromUrl(new Uri("https://twitter.com"), "", "");

                string responseURI = globusHttpHelper.gResponse.ResponseUri.ToString().ToLower();

                if (response_Login.Contains("signout") || homePage.Contains("signout"))
                {
                    postAuthenticityToken = PostAuthenticityToken(response_Login, "postAuthenticityToken");

                    try
                    {
                        int startIndx = response_Login.IndexOf("data-user-id=\"") + "data-user-id=\"".Length;
                        int endIndx = response_Login.IndexOf("\"", startIndx);
                        userID = response_Login.Substring(startIndx, endIndx - startIndx);
                    }
                    catch { }

                    if (string.IsNullOrEmpty(userID))
                    {
                        userID = string.Empty;
                        string[] useridarr = System.Text.RegularExpressions.Regex.Split(response_Login, "data-user-id=");
                        foreach (string useridarr_item in useridarr)
                        {
                            if (useridarr_item.Contains("data-screen-name="))
                            {
                                userID = useridarr_item.Substring(0 + 1, useridarr_item.IndexOf("data-screen-name=") - 3);
                                break;
                            }
                        }
                    }

                    IsLoggedIn = true;

                    Log("[ " + DateTime.Now + " ] => [ Logged in with " + Username + " ]");
                    GetScreen_name(homePage);
                    clsDBQueryManager Db = new clsDBQueryManager();
                    GetFollowercount();
                    Db.InsertScreenNameFollower(Screen_name, FollowerCount,FollwingCount, Username,ProfileFullName);
                    //GetDirectMessageDetails(Username, Password, Screen_name, FollowerCount, FollwingCount);
                }
                else if (response_Login.Contains("error"))
                {
                    //Log("[ " + DateTime.Now + " ] => [ Login Error with " + Username + " ]");
                    IsLoggedIn = false;
                    IsNotSuspended = true;
                    GlobusFileHelper.AppendStringToTextfileNewLine(Username + ":" + Password + ":" + proxyAddress + ":" + proxyPort + ":" + proxyUsername + ":" + proxyPassword, Globals.path_FailedLoginAccounts);
                    return;
                }
                //else if (responseURI.Contains("captcha"))//(globusHttpHelper.gResponse.ResponseUri.ToString().Contains("captcha"))
                else if (response_Login.Contains("captcha"))
                {
                    Log("[ " + DateTime.Now + " ] => [ Asking Captcha with " + Username + " ]");
                    IsLoggedIn = false;
                    GlobusFileHelper.AppendStringToTextfileNewLine(Username + ":" + Password + ":" + proxyAddress + ":" + proxyPort + ":" + proxyUsername + ":" + proxyPassword, Globals.path_AskingCaptchaAccounts);
                    return;
                }

                else
                {
                    IsLoggedIn = false;
                    //Log("Login Error in Account : " + Username + ":" + Password);
                }
            }
            catch (Exception ex)
            {
                Log("[ " + DateTime.Now + " ] => [ Error in Login : "******" ]");
                Globals.proxyNotWorking = true;
                GlobusFileHelper.AppendStringToTextfileNewLine(Username + ":" + Password + ":" + proxyAddress + ":" + proxyPort + ":" + proxyUsername + ":" + proxyPassword, Globals.path_FailedLoginAccounts);
                Globussoft.GlobusFileHelper.AppendStringToTextfileNewLine(DateTime.Now + " --> Error --> Login() --> " + Username + ":" + Password + ":" + proxyAddress + ":" + proxyPort + ":" + proxyUsername + ":" + proxyPassword + " --> " + ex.Message, Globals.Path_TweetAccountManager);
                return;
            }
        }