Beispiel #1
0
        public bool LogoutChilkat(ref Chilkat.Http http)
        {


            try
            {
                string pageSource1 = http.QuickGetStr("http://www.facebook.com/");

                if (pageSource1.Contains("\"h\"") && pageSource1.Contains("post_form_id") && pageSource1.Contains("fb_dtsg"))
                {
                    string h = string.Empty;
                    string post_form_id = string.Empty;
                    string fb_dtsg = string.Empty;

                    if (pageSource1.Contains("\"h\""))
                    {
                        string strTemp = pageSource1.Substring(pageSource1.IndexOf("\"h\""), 200);
                        string[] ArrTemp = strTemp.Split('"');
                        h = ArrTemp[3];
                    }
                    if (pageSource1.Contains("post_form_id") && pageSource1.Contains("fb_dtsg"))
                    {
                        string strTemp = pageSource1.Substring(pageSource1.IndexOf("post_form_id"), 200);
                        string[] ArrTemp = strTemp.Split('"');
                        post_form_id = ArrTemp[2];
                        fb_dtsg = ArrTemp[6];
                    }

                    Chilkat.HttpRequest reqLogout = new Chilkat.HttpRequest();
                    reqLogout.UsePost();
                    //req.Path = "/login.php?login_attempt=1";
                    reqLogout.RemoveAllParams();
                    reqLogout.AddHeader("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.16) Gecko/20110319 Firefox/3.6.16");
                    //req.SetFromUrl("http://www.facebook.com/login.php?login_attempt=1");

                    reqLogout.AddParam("post_form_id", post_form_id);
                    reqLogout.AddParam("fb_dtsg", fb_dtsg);
                    reqLogout.AddParam("ref", "mb");
                    reqLogout.AddParam("h", h);

                    Chilkat.HttpResponse respUsingPostURLEncoded = http.PostUrlEncoded("http://www.facebook.com/logout.php", reqLogout);
                    string ResponseLoginPostURLEncoded = respUsingPostURLEncoded.BodyStr;

                    string pageSource12 = http.QuickGetStr("http://www.facebook.com/");


                    return true;
                }

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

        }
Beispiel #2
0
        public bool CheckVerificationChilkat(string response, ref Chilkat.Http Http)
        {
            //** FB Account Check email varified or not ***********************************************************************************//
            #region  FB Account Check email varified or not
            string pageSourceCheck = string.Empty;
            pageSourceCheck = response;
            string pageSrc1 = string.Empty;
            string pageSrc2 = string.Empty;
            string pageSrc3 = string.Empty;
            string pageSrc4 = string.Empty;
            string substr1 = string.Empty;


            //if (pageSourceCheck.Contains("Are your friends already on Facebook?") && pageSourceCheck.Contains("Skip this step"))
            //{
            //    pageSrc1 = Http.QuickGetStr("http://www.facebook.com/gettingstarted.php?step=classmates_coworkers");
            //}
            //if (pageSrc1.Contains("Fill out your Profile Info") && pageSrc1.Contains("Skip"))
            //{
            //    pageSrc2 = Http.QuickGetStr("http://www.facebook.com/gettingstarted.php?step=upload_profile_pic");
            //}
            //if (pageSrc2.Contains("Set your profile picture") && pageSrc2.Contains("Skip"))
            //{
            //    pageSrc3 = Http.QuickGetStr("http://www.facebook.com/gettingstarted.php?step=summary");
            //}
            //if (pageSrc3.Contains("complete the sign-up process"))
            //{
            //    return false;

            //}
            //if (pageSourceCheck.Contains("complete the sign-up process"))
            //{
            //    return false;
            //}
            //#endregion
            ////** FB Account Check email varified or not ***********************************************************************************//
            //return true;

            if ((pageSourceCheck.Contains("Are your friends already on Facebook?") && pageSourceCheck.Contains("Skip this step")) || pageSourceCheck.Contains("window.location.replace(\"http:\\/\\/www.facebook.com\\/gettingstarted.php"))
            {
                pageSrc1 = Http.QuickGetStr("http://www.facebook.com/gettingstarted.php?step=classmates_coworkers");
                //}
                Thread.Sleep(300);
                //if (pageSrc1.Contains("Fill out your Profile Info") && pageSrc1.Contains("Skip"))
                //{
                pageSrc2 = Http.QuickGetStr("http://www.facebook.com/gettingstarted.php?step=upload_profile_pic");
                Thread.Sleep(300);
                //}
                //if (pageSrc2.Contains("Set your profile picture") && pageSrc2.Contains("Skip"))
                //{
                pageSrc3 = Http.QuickGetStr("http://www.facebook.com/gettingstarted.php?step=summary");
                Thread.Sleep(300);
                //}

                ///Check if asks for email
                //If asks then Set Status as PhoneVerfiedOnly
                if (pageSrc3.Contains("complete the sign-up process"))
                {
                    PumpMessage("Account : " + Username + " is NOT Email verified");
                    InsertUpdateDatabase(AccountStatus.Status(ProfileStatus.PhoneVerfiedOnly));
                    return false;
                }
                else if (pageSourceCheck.Contains("please login to your email account below") || pageSourceCheck.Contains("Go to your email"))
                {
                    PumpMessage("Account : " + Username + " is NOT Email verified");
                    InsertUpdateDatabase(AccountStatus.Status(ProfileStatus.PhoneVerfiedOnly));
                    return false;
                }
            }

            ///Means NOT Email verified
            //Check if asks for email
            //If asks then Set Status as PhoneVerfiedOnly
            if (pageSourceCheck.Contains("complete the sign-up process"))
            {
                PumpMessage("Account : " + Username + " is NOT Email verified");
                InsertUpdateDatabase(AccountStatus.Status(ProfileStatus.PhoneVerfiedOnly));
                return false;
            }
            else if (pageSourceCheck.Contains("window.location.replace(\"http:\\/\\/www.facebook.com\\/confirmemail.php"))
            {
                PumpMessage("Account : " + Username + " is NOT Email verified");
                InsertUpdateDatabase(AccountStatus.Status(ProfileStatus.PhoneVerfiedOnly));
                return false;
            }
            else if (pageSourceCheck.Contains("please login to your email account below") || pageSourceCheck.Contains("Go to your email"))
            {
                PumpMessage("Account : " + Username + " is NOT Email verified");
                InsertUpdateDatabase(AccountStatus.Status(ProfileStatus.PhoneVerfiedOnly));
                return false;
            }

            #endregion
            //** FB Account Check email varified or not ***********************************************************************************//

            PumpMessage("Account : " + Username + " is Email & Phone verified");
            InsertUpdateDatabase(AccountStatus.Status(ProfileStatus.PhonePlusEmailVerified));
            return true;

        }
        public string GetHtmlProxy_JSCSS(string URL, string proxyAddress, string proxyPort, string proxyUsername, string proxyPassword, string referer, ref Chilkat.Http http)
        {
            string response = string.Empty;

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

            ChangeProxy();
            ChangeProxy_Socks5();

            if (!http.UnlockComponent("THEBACHttp_b3C9o9QvZQ06"))
            {
            }

            ///Save Cookies...
            http.CookieDir = "memory";
            http.SendCookies = false;
            http.SaveCookies = true;

            http.SetRequestHeader("Accept-Encoding", "gzip,deflate");
            http.SetRequestHeader("Accept-Charset", "ISO-8859-1,utf-8;q=0.7,*;q=0.7");
            http.SetRequestHeader("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.24) Gecko/20111103 Firefox/3.6.24");
            http.SetRequestHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");

            response = http.QuickGetStr(URL);

            if (string.IsNullOrEmpty(response))
            {
                Thread.Sleep(500);
                response = http.QuickGetStr(URL);
            }
            if (string.IsNullOrEmpty(response))
            {
                Thread.Sleep(500);
                response = http.QuickGetStr(URL);
            }

            return response;
        }
        public string GetHtml(string URL, ref Chilkat.Http http)
        {
            string response = string.Empty;

            ChangeProxy();

            ChangeProxy_Socks5();

            if (!http.UnlockComponent("THEBACHttp_b3C9o9QvZQ06"))
            {
            }

            ///Save Cookies...
            http.CookieDir = "memory";
            //http.CookieDir = Application.StartupPath + "\\cookies";
            http.SendCookies = true;
            http.SaveCookies = true;

            http.SetRequestHeader("Accept-Encoding", "gzip,deflate");
            http.SetRequestHeader("Accept-Charset", "ISO-8859-1,utf-8;q=0.7,*;q=0.7;Unicode;");
            http.SetRequestHeader("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.24) Gecko/20111103 Firefox/3.6.24");
            http.SetRequestHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");

            //http.SetRequestHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
            //http.SetRequestHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
            http.SetRequestHeader("Connection", "keep-alive");

            http.AllowGzip = true;

            response = http.QuickGetStr(URL);

            //if (string.IsNullOrEmpty(response))
            //{
            //    Thread.Sleep(500);
            //    response = http.QuickGetStr(URL);
            //}
            if (string.IsNullOrEmpty(response))
            {
                Thread.Sleep(500);
                response = http.QuickGetStr(URL);
            }

            return response;
        }
        public string GetHtmlProxy(string URL, string proxyAddress, string proxyPort, string proxyUsername, string proxyPassword, ref Chilkat.Http http)
        {
            string response = string.Empty;

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

            ChangeProxy();

            if (!http.UnlockComponent("THEBACHttp_b3C9o9QvZQ06"))
            {
            }

            ///Save Cookies...
            http.CookieDir = "memory";
            http.SendCookies = true;
            http.SaveCookies = true;

            http.SetRequestHeader("Accept-Encoding", "gzip,deflate");
            http.SetRequestHeader("Accept-Charset", "ISO-8859-1,utf-8;q=0.7,*;q=0.7");
            http.SetRequestHeader("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.124 Safari/537.36");
            http.SetRequestHeader("Accept", "application/json, text/javascript, */*; q=0.01");
            http.SetRequestHeader("Accept-Language", "en-US,en;q=0.8");

            //http.SetRequestHeader("Accept-Encoding", "gzip,deflate");
            //http.SetRequestHeader("Accept-Charset", "ISO-8859-1,utf-8;q=0.7,*;q=0.7");
            //http.SetRequestHeader("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.24) Gecko/20111103 Firefox/3.6.24");
            //http.SetRequestHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");

            response = http.QuickGetStr(URL);

            return response;
        }
        public string GetHtmlProxy(string URL, string proxyAddress, string proxyPort, string proxyUsername, string proxyPassword, ref Chilkat.Http http)
        {
            string response = string.Empty;

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

            ChangeProxy();

            response = http.QuickGetStr(URL);

            return response;
        }
Beispiel #7
0
        public string GetHtmlIP(string URL, string IPAddress, string IPPort, string IPUsername, string IPpassword, ref Chilkat.Http http)
        {
            string response = string.Empty;

            this.IPAddress = IPAddress;
            this.IPPort = IPPort;
            this.IPUsername = IPUsername;
            this.IPpassword = IPpassword;

            ChangeIP();

            if (!http.UnlockComponent("THEBACHttp_b3C9o9QvZQ06"))
            {
            }

            ///Save Cookies...
            http.CookieDir = "memory";
            http.SendCookies = true;
            http.SaveCookies = true;

            http.SetRequestHeader("Accept-Encoding", "gzip,deflate");
            http.SetRequestHeader("Accept-Charset", "ISO-8859-1,utf-8;q=0.7,*;q=0.7");
            http.SetRequestHeader("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.24) Gecko/20111103 Firefox/3.6.24");
            http.SetRequestHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");

            response = http.QuickGetStr(URL);

            return response;
        }