示例#1
0
        public static void SendRequest()
        {
            Chilkat.HttpRequest req = new Chilkat.HttpRequest();

            req.HttpVerb    = "POST";
            req.Path        = @"/submission";
            req.ContentType = "multipart/form-data";

            req.AddHeader("Connection", "keep-alive");
            req.AddHeader("User-Agent", "Mozilla/5.0");
            req.AddHeader("Accept", @"*/*");

            req.AddParam("name", "khanhtv0112");
            req.AddParam("email", "*****@*****.**");
            req.AddParam("title", "VidMate");
            req.AddParam("category", "22");
            req.AddParam("platform", "7");
            req.AddParam("developer", "asd");
            req.AddParam("url", @"https://apkpure.com/vidmate-downloader-hd-live-tv/com.nemo.vidmate/download?from=details");
            req.AddParam("license", "asda");
            req.AddParam("file_size", "sdas");
            req.AddParam("detailed_description", "dasdfsdfsd");

            string pathToFileOnDisk = "D:\\Projects\\3DLUT_mobile.png";
            bool   success          = req.AddFileForUpload("image", pathToFileOnDisk);

            if (success != true)
            {
                Debug.WriteLine(req.LastErrorText);
                return;
            }

            Chilkat.Http         http = new Chilkat.Http();
            Chilkat.HttpResponse resp = http.SynchronousRequest("ahihisoftware.com", 443, true, req);
            if (http.LastMethodSuccess != true)
            {
                Debug.WriteLine(http.LastErrorText);
                return;
            }
            Debug.WriteLine("HTTP response status: " + Convert.ToString(resp.StatusCode));

            string htmlStr = resp.BodyStr;

            Debug.WriteLine("Received:");
            Debug.WriteLine(htmlStr);
        }
示例#2
0
        public TwitterHTTP(string proxyDomain, int proxyPort, string proxyUsername, string proxyPassword)
        {
            this.http = new Chilkat.Http();
            this.req = new Chilkat.HttpRequest();

            if ( ! http.UnlockComponent("Anything for 30-day trial") )
            {
                Console.WriteLine(http.LastErrorText);
                return;
            }

            if (!Directory.Exists("sessions"))
            {
                DirectoryInfo di = Directory.CreateDirectory("sessions");
            }

            if(proxyDomain != "false") this.http.ProxyDomain = proxyDomain;
            if (proxyPort != 0) this.http.ProxyPort = proxyPort;
            if (proxyUsername != "false") this.http.ProxyLogin = proxyUsername;
            if (proxyPassword != "false") this.http.ProxyPassword = proxyPassword;
        }
示例#3
0
        public bool EmailVerification(string Email, string Password, ref GlobusHttpHelper globushttpHelper)
        {
            bool IsActivated = false;

            try
            {
                Log("[ " + DateTime.Now + " ] => [ Please Wait Account Verification Start... ]");

                System.Windows.Forms.Application.DoEvents();
                Chilkat.Http http = new Chilkat.Http();

                if (Email.Contains("@yahoo"))
                {
                    #region Yahoo Verification Steps

                    GlobusHttpHelper HttpHelper = new GlobusHttpHelper();
                    bool             activate   = false;
                    try
                    {
                        bool emaildata = false;
                        //Chilkat.Http http = new Chilkat.Http();
                        ///Chilkat Http Request to be used in Http Post...
                        Chilkat.HttpRequest req = new Chilkat.HttpRequest();
                        bool success;

                        // Any string unlocks the component for the 1st 30-days.
                        success = http.UnlockComponent("THEBACHttp_b3C9o9QvZQ06");
                        if (success != true)
                        {
                            Console.WriteLine(http.LastErrorText);
                            return(false);
                        }

                        http.CookieDir   = "memory";
                        http.SendCookies = true;
                        http.SaveCookies = true;

                        //http.ProxyDomain = "127.0.0.1";
                        //http.ProxyPort = 8888;
                        http.SetRequestHeader("Accept-Encoding", "gzip,deflate");
                        Chilkat.Imap iMap     = new Imap();
                        string       Username = Email;

                        iMap.UnlockComponent("THEBACIMAPMAILQ_OtWKOHoF1R0Q");
                        //iMap.
                        //iMap.HttpProxyHostname = "127.0.0.1";
                        //iMap.HttpProxyPort = 8888;

                        iMap.Port = 993;
                        iMap.Connect("imap.n.mail.yahoo.com");
                        iMap.Login(Email, Password);
                        iMap.SelectMailbox("Inbox");

                        // Get a message set containing all the message IDs
                        // in the selected mailbox.
                        Chilkat.MessageSet msgSet;
                        //msgSet = iMap.Search("FROM \"facebookmail.com\"", true);

                        msgSet = iMap.GetAllUids();


                        if (msgSet.Count <= 0)
                        {
                            msgSet = iMap.GetAllUids();
                        }

                        // Fetch all the mail into a bundle object.
                        Chilkat.Email email = new Chilkat.Email();
                        //bundle = iMap.FetchBundle(msgSet);
                        string        strEmail = string.Empty;
                        List <string> lstData  = new List <string>();
                        if (msgSet != null)
                        {
                            for (int i = 0; i < msgSet.Count; i++)
                            {
                                try
                                {
                                    email    = iMap.FetchSingle(msgSet.GetId(i), true);
                                    strEmail = email.Subject;
                                    string emailHtml = email.GetHtmlBody();
                                    lstData.Add(strEmail);

                                    string from = email.From.ToString().ToLower();

                                    if (from.Contains("@linkedin.com"))
                                    {
                                        foreach (string href in GetUrlsFromString(email.Body))
                                        {
                                            try
                                            {
                                                if (href.Contains("http://www.linkedin.com/e/csrf") || href.Contains("http://www.linkedin.com/e/ato") || href.Contains("http://www.linkedin.com/e/v2?e"))
                                                {
                                                    string EscapeEmail = Uri.EscapeDataString(Email).Replace(".", "%2E").Trim();
                                                    {
                                                        string ConfirmationResponse = globushttpHelper.getHtmlfromUrl1(new Uri(href));
                                                        IsActivated = true;
                                                        break;
                                                    }
                                                }
                                            }
                                            catch (Exception ex)
                                            {
                                                Console.WriteLine("6 :" + ex.StackTrace);
                                            }
                                        }
                                    }
                                    if (IsActivated)
                                    {
                                        Log("[ " + DateTime.Now + " ] => [ Account : " + Email + " verified ]");
                                        break;
                                    }
                                }
                                catch (Exception ex)
                                {
                                    Console.WriteLine("Error >>> " + ex.StackTrace);
                                }
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine("7 :" + ex.StackTrace);
                        Log("[ " + DateTime.Now + " ] => [ Email Verification Exception : " + ex.Message + "StackTrace --> >>>" + ex.StackTrace + " with : " + Email + " ]");
                        Log("[ " + DateTime.Now + " ] => [ Please check your Login Id and Password ]");
                    }
                    return(IsActivated);

                    #endregion
                }
                else
                {
                    string Host = string.Empty;
                    int    Port = 0;
                    if (Email.Contains("@gmail"))
                    {
                        Host = "pop.gmail.com";
                        Port = 995;
                    }
                    else if (Email.Contains("@hotmail"))
                    {
                        Host = "pop3.live.com";
                        Port = 995;
                    }
                    else if (Email.Contains("@gmx"))
                    {
                        Host = "pop.gmx.com";
                        Port = 995;
                    }
                    if (!string.IsNullOrEmpty(Host))
                    {
                        try
                        {
                            if (popClient.Connected)
                            {
                                popClient.Disconnect();
                            }
                            popClient.Connect(Host, Port, true);
                            popClient.Authenticate(Email, Password);
                        }
                        catch (Exception ex)
                        {
                            Console.WriteLine(ex.StackTrace);

                            //retry once
                            System.Threading.Thread.Sleep(1000);

                            if (popClient.Connected)
                            {
                                popClient.Disconnect();
                            }
                            popClient.Connect(Host, Port, true);
                            popClient.Authenticate(Email, Password);
                        }


                        //if (!)
                        //{

                        //}

                        int Count = popClient.GetMessageCount();

                        for (int i = Count; i >= 1; i--)
                        {
                            try
                            {
                                OpenPOP.MIME.Message Message = popClient.GetMessage(i);
                                string subject = string.Empty;
                                subject = Message.Headers.Subject;
                                string frowwm      = Message.Headers.From.ToString();
                                bool   GoIntoEmail = false;

                                if (string.IsNullOrEmpty(subject))
                                {
                                    string from = Message.Headers.From.ToString().ToLower();
                                    if (from.Contains("linkedin.com"))
                                    {
                                        GoIntoEmail = true;
                                    }
                                }
                                try
                                {
                                    if (frowwm.Contains("linkedin.com"))
                                    //if(GoIntoEmail)
                                    {
                                        string Messagebody = Message.MessageBody[0];

                                        foreach (string href in GetUrlsFromStringGmail(Messagebody))
                                        {
                                            try
                                            {
                                                if (href.Contains("http://www.linkedin.com/e/csrf") || href.Contains("http://www.linkedin.com/e/ato") || href.Contains("http://www.linkedin.com/e/v2?e"))
                                                {
                                                    string href1       = href.Replace("amp;", string.Empty);
                                                    string EscapeEmail = Uri.EscapeDataString(Email).Replace(".", "%2E").Trim();
                                                    {
                                                        string ConfirmationResponse = globushttpHelper.getHtmlfromUrl1(new Uri(href1));
                                                        IsActivated = true;
                                                        break;
                                                    }
                                                }
                                            }
                                            catch (Exception ex)
                                            {
                                                Console.WriteLine("5 :" + ex.StackTrace);
                                            };
                                        }
                                    }
                                }
                                catch (Exception ex)
                                {
                                    Console.WriteLine("10 :" + ex.StackTrace);
                                    Log("[ " + DateTime.Now + " ] => [ Email Verification Exception : " + ex.Message + "StackTrace --> >>>" + ex.StackTrace + " with : " + Email + " ]");
                                }
                                if (IsActivated)
                                {
                                    break;
                                }
                            }
                            catch (Exception ex)
                            {
                                {
                                    Log("[ " + DateTime.Now + " ] => [ Email Verification Exception : " + ex.Message + "StackTrace --> >>>" + ex.StackTrace + " with : " + Email + " ]");
                                    Log("[ " + DateTime.Now + " ] => [ Please check your Login Id and Password ]");
                                }
                            }
                        }
                    }
                }
                return(IsActivated);
            }
            catch (Exception ex)
            {
                Console.WriteLine("4 :" + ex.StackTrace);
                return(IsActivated);
            }
        }
示例#4
0
        public bool GetYahooMails(string yahooEmail, string yahooPassword)
        {
            GlobusHttpHelper HttpHelper = new GlobusHttpHelper();
            bool             activate   = false;

            try
            {
                bool emaildata = false;

                Chilkat.Http http = new Chilkat.Http();



                ///Chilkat Http Request to be used in Http Post...
                Chilkat.HttpRequest req = new Chilkat.HttpRequest();
                bool success;

                // Any string unlocks the component for the 1st 30-days.
                success = http.UnlockComponent("THEBACHttp_b3C9o9QvZQ06");
                if (success != true)
                {
                    Console.WriteLine(http.LastErrorText);
                    return(false);
                }
                http.CookieDir   = "memory";
                http.SendCookies = true;
                http.SaveCookies = true;

                //http.ProxyDomain = "127.0.0.1";
                //http.ProxyPort = 8888;



                http.SetRequestHeader("Accept-Encoding", "gzip,deflate");



                Chilkat.Imap iMap     = new Imap();
                string       Username = yahooEmail;
                string       Password = yahooPassword;
                //Username = "******";
                //Password = "******";
                iMap.UnlockComponent("THEBACIMAPMAILQ_OtWKOHoF1R0Q");

                //iMap.
                //iMap.HttpProxyHostname = "127.0.0.1";
                //iMap.HttpProxyPort = 8888;

                iMap.Connect("imap.n.mail.yahoo.com");
                iMap.Login(yahooEmail, yahooPassword);
                iMap.SelectMailbox("Inbox");

                // Get a message set containing all the message IDs
                // in the selected mailbox.
                Chilkat.MessageSet msgSet;
                //msgSet = iMap.Search("FROM \"facebookmail.com\"", true);
                msgSet = iMap.GetAllUids();

                // Fetch all the mail into a bundle object.
                Chilkat.Email email = new Chilkat.Email();
                //bundle = iMap.FetchBundle(msgSet);
                string        strEmail = string.Empty;
                List <string> lstData  = new List <string>();
                if (msgSet != null)
                {
                    for (int i = msgSet.Count; i > 0; i--)
                    {
                        email    = iMap.FetchSingle(msgSet.GetId(i), true);
                        strEmail = email.Subject;
                        string emailHtml = email.GetHtmlBody();
                        lstData.Add(strEmail);


                        if (email.Subject.Contains("[WordPress] Activate") && email.Subject.Contains("wordpress.com"))
                        {
                            foreach (string href in GetUrlsFromString(email.Body))
                            {
                                try
                                {
                                    string staticUrl = string.Empty;


                                    staticUrl = href;
                                    responce  = http.QuickGetStr(staticUrl);

                                    if (responce.Contains("Your account is now active"))
                                    {
                                        emaildata = true;
                                        //Log("your Account is activate now");
                                        activate = true;
                                    }
                                }
                                catch (Exception ex)
                                {
                                    Console.WriteLine(ex.StackTrace);
                                }
                            }
                        }
                    }
                }
                if (emaildata == false)
                {
                    Log("[ " + DateTime.Now + " ] => [ activation link is not find in user account so your Account is not activate please activate now ]");
                }
            }
            catch (Exception ex)
            {
            }
            return(activate);
        }
示例#5
0
        public bool gmail(string Email, string Password)
        {
            GlobusHttpHelper HttpHelper = new GlobusHttpHelper();
            bool             activate   = false;

            Chilkat.Http http = new Chilkat.Http();



            ///Chilkat Http Request to be used in Http Post...
            Chilkat.HttpRequest req = new Chilkat.HttpRequest();
            bool success;

            // Any string unlocks the component for the 1st 30-days.
            success = http.UnlockComponent("THEBACHttp_b3C9o9QvZQ06");
            if (success != true)
            {
                Console.WriteLine(http.LastErrorText);
                return(false);
            }
            http.CookieDir   = "memory";
            http.SendCookies = true;
            http.SaveCookies = true;

            //http.ProxyDomain = "127.0.0.1";
            //http.ProxyPort = 8888;


            http.SetRequestHeader("Accept-Encoding", "gzip,deflate");


            if (Email.Contains("@gmail"))
            {
                if (popClient.Connected)
                {
                    popClient.Disconnect();
                }
                popClient.Connect("pop.gmail.com", int.Parse("995"), true);
                popClient.Authenticate(Email, Password);
                int Count = popClient.GetMessageCount();

                for (int i = Count; i >= 1; i--)
                {
                    OpenPOP.MIME.Message Message = popClient.GetMessage(i);

                    string subject = Message.Headers.Subject;

                    if (Message.Headers.Subject.Contains("[WordPress] Activate") && Message.Headers.Subject.Contains("wordpress.com"))
                    {
                        foreach (string href in GetUrlsFromStringGmail(Message.MessageBody[0]))
                        {
                            try
                            {
                                string staticUrl = string.Empty;

                                staticUrl = href;

                                responce = http.QuickGetStr(staticUrl);
                                if (responce.Contains("Your account is now active"))
                                {
                                    Log("[ " + DateTime.Now + " ] => [ Account activated ]");
                                    activate = true;
                                }
                            }
                            catch (Exception ex)
                            {
                            }
                        }
                    }
                }
            }
            return(activate);
        }
示例#6
0
        public bool ActivationProcess(string ActivationUrl)
        {
            bool IsActivated = false;

            try
            {
                Chilkat.Http http = new Chilkat.Http();

                ///Chilkat Http Request to be used in Http Post...
                Chilkat.HttpRequest req = new Chilkat.HttpRequest();
                bool success;

                // Any string unlocks the component for the 1st 30-days.
                success = http.UnlockComponent("THEBACHttp_b3C9o9QvZQ06");
                if (success != true)
                {
                    Console.WriteLine(http.LastErrorText);
                }
                http.CookieDir   = "memory";
                http.SendCookies = true;
                http.SaveCookies = true;


                http.SetRequestHeader("Accept-Encoding", "gzip,deflate");


                //complete url with website and address
                string siteurl = "http://blog.com/wp-login.php";
                //siteurl = Website;

                //  Send the HTTP GET and return the content in a string.
                string html = null;
                //html = http.QuickGetStr(siteurl);
                string actvateUrl = ActivationUrl.Substring(ActivationUrl.IndexOf("http"));

                html = http.QuickGetStr(actvateUrl);

                if (responce.Contains("Your account is now active"))
                {
                    Log("[ " + DateTime.Now + " ] => [ Account activated ]");
                    IsActivated = true;
                }

                if (!string.IsNullOrEmpty(html))
                {
                    if (html.Contains("Your account is now active") || html.Contains("Back to"))
                    {
                        //                   Log("blog account verified");

                        return(true);
                    }
                    else
                    {
                        //                  Log("blog account not verified");
                        return(false);
                    }
                }
                else
                {
                }
            }
            catch (Exception ex)
            {
            }


            return(IsActivated);
        }
示例#7
0
        public void CrawlingPageDataSource(string Url, ref GlobusHttpHelper HttpHelper)
        {
            if (SearchCriteria.starter)
            {
                if (SearchCriteria.starter)
                {
                    try
                    {
                        Log("[ " + DateTime.Now + " ] => [ Start Parsing Process ]");

                        #region Data Initialization

                        string Industry = string.Empty;
                        string URLprofile = string.Empty;
                        string firstname = string.Empty;
                        string lastname = string.Empty;
                        string location = string.Empty;
                        string country = string.Empty;
                        string postal = string.Empty;
                        string phone = string.Empty;
                        string USERemail = string.Empty;
                        string code = string.Empty;
                        string education1 = string.Empty;
                        string education2 = string.Empty;
                        string titlecurrent = string.Empty;
                        string companycurrent = string.Empty;
                        string titlepast1 = string.Empty;
                        string companypast1 = string.Empty;
                        string titlepast2 = string.Empty;
                        string html = string.Empty;
                        string companypast2 = string.Empty;
                        string titlepast3 = string.Empty;
                        string companypast3 = string.Empty;
                        string titlepast4 = string.Empty;
                        string companypast4 = string.Empty;
                        string Recommendations = string.Empty;
                        string Connection = string.Empty;
                        string Designation = string.Empty;
                        string Website = string.Empty;
                        string Contactsettings = string.Empty;
                        string recomandation = string.Empty;

                        string titleCurrenttitle = string.Empty;
                        string titleCurrenttitle2 = string.Empty;
                        string titleCurrenttitle3 = string.Empty;
                        string titleCurrenttitle4 = string.Empty;
                        string Skill = string.Empty;
                        //string TypeOfProfile = "Public1";

                        string Finaldata = string.Empty;
                        #endregion

                        #region LDS_DataInitialization
                        string LDS_FirstName = string.Empty;
                        string LDS_LastName = string.Empty;
                        string LDS_UserProfileLink = string.Empty;
                        string LDS_HeadLineTitle = string.Empty;
                        string LDS_CurrentTitle = string.Empty;
                        string LDS_PastTitles = string.Empty;
                        string LDS_Loction = string.Empty;
                        string LDS_Country = string.Empty;
                        string LDS_Connection = string.Empty;
                        string LDS_Recommendations = string.Empty;
                        string LDS_SkillAndExpertise = string.Empty;
                        string LDS_Education = string.Empty;
                        string LDS_Experience = string.Empty;
                        string LDS_ProfileType = "Public";
                        string LDS_Groups = string.Empty;
                        string LDS_UserEmail = string.Empty;
                        string LDS_UserContactNumber = string.Empty;
                        string LDS_CurrentCompany = string.Empty;
                        string LDS_PastCompany = string.Empty;
                        string LDS_LoginID = string.Empty;
                        string LDS_Websites = string.Empty;
                        string LDS_Industry = string.Empty;

                        string companyCurrenttitle1 = string.Empty;
                        string companyCurrenttitle2 = string.Empty;
                        string companyCurrenttitle3 = string.Empty;
                        string companyCurrenttitle4 = string.Empty;

                        #endregion

                        #region Chilkat Initialization

                        Chilkat.Http http = new Chilkat.Http();

                        ///Chilkat Http Request to be used in Http Post...
                        Chilkat.HttpRequest req = new Chilkat.HttpRequest();
                        Chilkat.HtmlUtil htmlUtil = new Chilkat.HtmlUtil();

                        // Any string unlocks the component for the 1st 30-days.
                        bool success = http.UnlockComponent("THEBACHttp_b3C9o9QvZQ06");
                        if (success != true)
                        {
                            System.Console.WriteLine(http.LastErrorText);
                            return;
                        }

                        http.CookieDir = "memory";
                        http.SendCookies = true;
                        http.SaveCookies = true;

                        html = HttpHelper.getHtmlfromUrl1(new Uri(Url));

                        html = htmlUtil.EntityDecode(html);

                        ////  Convert the HTML to XML:
                        Chilkat.HtmlToXml htmlToXml = new Chilkat.HtmlToXml();
                        Chilkat.HtmlToXml htmlToXml1 = new Chilkat.HtmlToXml();
                        Chilkat.HtmlToXml htmlToXml2 = new Chilkat.HtmlToXml();
                        success = htmlToXml.UnlockComponent("THEBACHtmlToXml_7WY3A57sZH3O");
                        if ((success != true))
                        {
                            Console.WriteLine(htmlToXml.LastErrorText);
                            return;
                        }

                        string xHtml = null;
                        string xHtml1 = null;
                        //string xHtml2 = null;

                        htmlToXml.Html = html;
                        xHtml = htmlToXml.ToXml();

                        Chilkat.Xml xml = new Chilkat.Xml();
                        xml.LoadXml(xHtml);

                        ////  Iterate over all h1 tags:
                        Chilkat.Xml xNode = default(Chilkat.Xml);
                        Chilkat.Xml xBeginSearchAfter = default(Chilkat.Xml);

                        #endregion

                        #region for paRSING
                        List<string> list = new List<string>();
                        List<string> Grouplist = new List<string>();
                        List<string> listtitle = new List<string>();
                        List<string> Currentlist = new List<string>();
                        List<string> Skilllst = new List<string>();
                        list.Clear();

                        //new parshing code

                        List<string> TempFirstName = objChilkat.GetDataTagAttributewithId(html, "div", "name-container");

                        xBeginSearchAfter = null;

                        xNode = xml.SearchForTag(xBeginSearchAfter, "dt");

                        Grouplist.Clear();
                        xBeginSearchAfter = null;
                        #region parsergroup
                        xNode = xml.SearchForAttribute(xBeginSearchAfter, "div", "class", "group-data");

                        while ((xNode != null))
                        {
                            Finaldata = xNode.AccumulateTagContent("text", "/text");

                            Grouplist.Add(Finaldata);

                            string[] tempC1 = Regex.Split(Finaldata, " at ");

                            xBeginSearchAfter = xNode;
                            xNode = xml.SearchForAttribute(xBeginSearchAfter, "div", "class", "group-data");

                        }

                        int groupcounter = 0;
                        string AllGRoup = string.Empty;
                        foreach (string item in Grouplist)
                        {
                            if (item.Contains("Join"))
                            {
                                if (groupcounter == 0)
                                {
                                    LDS_Groups = item;
                                    groupcounter++;
                                }
                                else
                                {
                                    LDS_Groups = AllGRoup + ";" + item;
                                }

                            }

                        }
                        #endregion

                        #region parserSkill
                        xNode = xml.SearchForTag(xBeginSearchAfter, "dt");

                        Skilllst.Clear();
                        xBeginSearchAfter = null;

                        xNode = xml.SearchForAttribute(xBeginSearchAfter, "div", "id", "profile-skills");

                        while ((xNode != null))
                        {
                            Finaldata = xNode.AccumulateTagContent("text", "/text");
                            if (Finaldata.Contains("extlib: _toggleclass"))
                            {
                                try
                                {
                                    string[] Temp = Finaldata.Split(';');
                                    LDS_SkillAndExpertise = Temp[4];
                                }
                                catch { }

                            }
                            else
                            {
                                try
                                {
                                    LDS_SkillAndExpertise = Finaldata.Replace("Skills & Expertise", " ");
                                    Skilllst.Add(Finaldata);
                                }
                                catch { }
                            }

                            xBeginSearchAfter = xNode;
                            xNode = xml.SearchForAttribute(xBeginSearchAfter, "div", "id", "profile-skills");

                        }

                        if (LDS_SkillAndExpertise.Contains(" Endorsements LI.i18n.register('section_skills_person_endorsed_tmpl"))
                        {
                            LDS_SkillAndExpertise = string.Empty;
                        }

                        Skilllst.Distinct();
                        #endregion

                        #region UrlProfile
                        try
                        {
                            if (html.Contains("webProfileURL"))
                            {
                                int FirstPointForProfileURL = html.IndexOf("webProfileURL");
                                string FirstSubStringForProfileURL = html.Substring(FirstPointForProfileURL);
                                int SecondPointForProfileURL = FirstSubStringForProfileURL.IndexOf(">");
                                int ThirdPointForProfileURL = FirstSubStringForProfileURL.IndexOf("</a>");

                                string SecondSubStringForProfileURL = FirstSubStringForProfileURL.Substring(SecondPointForProfileURL, ThirdPointForProfileURL - SecondPointForProfileURL);
                                LDS_UserProfileLink = SecondSubStringForProfileURL.Replace(">", string.Empty);
                                //qm.AddProfileUrl(URLprofile, DateTime.Now.ToString(), "0");
                            }
                        }
                        catch (Exception ex)
                        {
                            Console.WriteLine(ex.Message);
                        }

                        try
                        {
                            string[] UrlFull = System.Text.RegularExpressions.Regex.Split(Url, "&authType");
                            LDS_UserProfileLink = UrlFull[0];

                            LDS_UserProfileLink = Url;
                        }
                        catch { }
                        #endregion

                        #region Connection
                        if (html.Contains("overview-connections"))
                        {
                            try
                            {
                                Connection = html.Substring(html.IndexOf("leo-module mod-util connections"), 500);
                                string[] Arr = Connection.Split('>');
                                string tempConnection = Arr[5].Replace("</strong", "").Replace(")</h3", "").Replace("(", "");
                                if (tempConnection.Length < 8)
                                {
                                    LDS_Connection = tempConnection + "Connection";
                                }
                                else
                                {
                                    LDS_Connection = string.Empty;
                                }
                            }
                            catch (Exception ex)
                            {
                                //overview-connections
                                try
                                {
                                    LDS_Connection = html.Substring(html.IndexOf("overview-connections"), 50);
                                    string[] Arr = Connection.Split('>');
                                    string tempConnection = Arr[3].Replace("</strong", "").Replace(")</h3", "").Replace("(", "");
                                    LDS_Connection = tempConnection + "Connection";
                                }
                                catch { }
                            }
                        }
                        #endregion

                        #region Recommendation
                        if (html.Contains("Recommendations"))
                        {

                            try
                            {
                                string[] rList = System.Text.RegularExpressions.Regex.Split(html, "Recommendations");
                                string[] R3List = rList[2].Split('\n');
                                string temprecomandation = R3List[4].Replace("</strong>", "").Replace("<strong>", "");
                                if (temprecomandation.Contains("recommended"))
                                {
                                    LDS_Recommendations = temprecomandation;
                                }
                                else
                                {
                                    LDS_Recommendations = "";
                                }

                            }
                            catch (Exception ex)
                            {
                                LDS_Recommendations = string.Empty;
                            }
                        }
                        #endregion

                        #region Websites
                        if (html.Contains("websites"))
                        {
                            try
                            {
                                string websitedem = html.Substring(html.IndexOf("websites"), 500);

                                string[] Arr = Regex.Split(websitedem, "href");
                                foreach (string item in Arr)
                                {
                                    if (item.Contains("redir/redirect?url"))
                                    {
                                        string tempArr = item.Substring(item.IndexOf("name="), 50);
                                        string[] temarr = tempArr.Split('\n');
                                        LDS_Websites = temarr[1];
                                    }
                                }

                            }
                            catch (Exception ex)
                            {
                                LDS_Websites = string.Empty;
                            }
                        }
                        #endregion

                        #region Getting Industry
                        try
                        {

                            string Industrytemp = html.Substring(html.IndexOf("Find users in this industry"), 100);
                            string[] TempIndustery = Industrytemp.Split('>');
                            LDS_Industry = TempIndustery[1].Replace("</strong", "").Replace("</a", "");

                        }
                        catch (Exception ex)
                        {
                            Console.WriteLine(ex.Message);
                        }
                        #endregion

                        #region Getting First Name
                        try
                        {
                            if (html.Contains("given-name"))
                            {
                                int FirstPointForProfilename = html.IndexOf("given-name");
                                string FirstSubStringForProfilename = html.Substring(FirstPointForProfilename);
                                int SecondPointForProfilename = FirstSubStringForProfilename.IndexOf(">");
                                int ThirdPointForProfilename = FirstSubStringForProfilename.IndexOf("</span>");

                                string SecondSubStringForProfilename = FirstSubStringForProfilename.Substring(SecondPointForProfilename, ThirdPointForProfilename - SecondPointForProfilename);
                                LDS_FirstName = SecondSubStringForProfilename.Replace(">", string.Empty);
                            }
                        }
                        catch (Exception ex)
                        {
                            Console.WriteLine(ex.Message);
                        }
                        #endregion

                        #region LastName
                        try
                        {
                            if (html.Contains("family-name"))
                            {
                                int FirstPointForProfilelastname = html.IndexOf("family-name");
                                string FirstSubStringForProfilelastname = html.Substring(FirstPointForProfilelastname);
                                int SecondPointForProfilelastname = FirstSubStringForProfilelastname.IndexOf(">");
                                int ThirdPointForProfilelastname = FirstSubStringForProfilelastname.IndexOf("</span>");

                                string SecondSubStringForProfilelastname = FirstSubStringForProfilelastname.Substring(SecondPointForProfilelastname, ThirdPointForProfilelastname - SecondPointForProfilelastname);
                                string templastname = SecondSubStringForProfilelastname.Replace(">", string.Empty);
                                if (templastname.Contains(","))
                                {
                                    string[] arrylastname = templastname.Split(',');
                                    LDS_LastName = arrylastname[0];
                                }
                                else
                                {
                                    LDS_LastName = templastname;
                                }
                            }
                        }
                        catch (Exception ex)
                        {
                            Console.WriteLine(ex.Message);
                        }

                        #endregion

                        #region Designation Company Current
                        try
                        {
                            if (html.Contains("phonetic-full-name"))
                            {
                                int FirstPointForProfileCurrent = html.IndexOf("phonetic-full-name");
                                string FirstSubStringForProfileCurrent = html.Substring(FirstPointForProfileCurrent);
                                int SecondPointForProfileCurrent = FirstSubStringForProfileCurrent.IndexOf("display:block");
                                int ThirdPointForProfileCurrent = FirstSubStringForProfileCurrent.IndexOf("</p>");

                                string SecondSubStringForProfileCurrent = FirstSubStringForProfileCurrent.Substring(SecondPointForProfileCurrent, ThirdPointForProfileCurrent - SecondPointForProfileCurrent);
                                titlecurrent = SecondSubStringForProfileCurrent.Replace("\">", "").Replace("display:block", string.Empty).Replace("<strong class=\"highlight\"", string.Empty).Replace("</strong", string.Empty).Trim();
                                string[] tempCCurent = Regex.Split(titlecurrent, " at ");
                                LDS_HeadLineTitle = titlecurrent.Replace(",", ";");
                                LDS_CurrentCompany = tempCCurent[1].Replace(",", ";");

                            }

                            else if (html.Contains("<p class=\"title\""))
                            {
                                LDS_HeadLineTitle = html.Substring(html.IndexOf("<p class=\"title\""), 150);
                                string[] HeadLineTitle = LDS_HeadLineTitle.Split('>');
                                string tempHeadLineTitle = HeadLineTitle[1].Replace("\n", "").Replace(")</h3", "").Replace("</p", "");
                                LDS_HeadLineTitle = tempHeadLineTitle;
                                try
                                {
                                    string[] tempCCurent = Regex.Split(tempHeadLineTitle, " at ");
                                    LDS_HeadLineTitle = tempCCurent[0];
                                    LDS_CurrentCompany = tempCCurent[1];
                                }
                                catch { }
                            }

                        }
                        catch (Exception ex)
                        {
                            Console.WriteLine(ex.Message);
                        }
                        #endregion

                        #region Education
                        try
                        {
                            if (html.Contains("summary-education"))
                            {
                                int FirstPointForProfileeducation1 = html.IndexOf("summary-education");
                                string FirstSubStringForProfileeducation1 = html.Substring(FirstPointForProfileeducation1);
                                int SecondPointForProfileeducation1 = FirstSubStringForProfileeducation1.IndexOf("<li>");
                                int ThirdPointForProfileeducation1 = FirstSubStringForProfileeducation1.IndexOf("</li>");

                                string SecondSubStringForProfileeducation1 = FirstSubStringForProfileeducation1.Substring(SecondPointForProfileeducation1, ThirdPointForProfileeducation1 - SecondPointForProfileeducation1);
                                education1 = SecondSubStringForProfileeducation1.Replace("<li>", string.Empty).Replace(",", string.Empty).Trim();

                            }

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

                        #endregion

                        #region Country
                        try
                        {
                            if (html.Contains("locality"))
                            {
                                int FirstPointForlocality = html.IndexOf("locality");
                                string FirstSubStringForlocality = html.Substring(FirstPointForlocality);
                                int SecondPointForlocality = FirstSubStringForlocality.IndexOf("location");
                                int ThirdPointForlocality = FirstSubStringForlocality.IndexOf("</a>");

                                string SecondSubStringForlocality = FirstSubStringForlocality.Substring(SecondPointForlocality, ThirdPointForlocality - SecondPointForlocality);
                                string temlocation = SecondSubStringForlocality.Replace("location", string.Empty).Replace(">", string.Empty).Replace('"', ' ');
                                string[] temp = temlocation.Split(',');
                                LDS_Loction = temp[0].Replace("<strong class= highlight", string.Empty).Replace("</strong", string.Empty);
                                LDS_Country = temp[1].Replace("<strong class= highlight", string.Empty).Replace("</strong", string.Empty);
                                // country = temp[1].Replace("</strong", string.Empty);
                            }

                        }
                        catch (Exception ex)
                        {
                            Console.WriteLine(ex.Message);
                        }
                        #endregion

                        #region User Email
                        try
                        {
                            if (html.Contains("Email & Phone:"))
                            {
                                int FirstPointFortitlepast1 = html.IndexOf("abook-email");
                                string FirstSubStringFortitlepast1 = html.Substring(FirstPointFortitlepast1);
                                int SecondPointFortitlepast1 = FirstSubStringFortitlepast1.IndexOf("<a");
                                int ThirdPointFortitlepast1 = FirstSubStringFortitlepast1.IndexOf("</a>");

                                string SecondSubStringFortitlepast1 = FirstSubStringFortitlepast1.Substring(SecondPointFortitlepast1, ThirdPointFortitlepast1 - SecondPointFortitlepast1);
                                string[] tempEmail = SecondSubStringFortitlepast1.Split('>');
                                LDS_UserEmail = tempEmail[1];

                            }

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

                        #endregion

                        #region Type Of profile
                        try
                        {
                            if (html.Contains("profile-header"))
                            {
                                int FirstPointForProfileType = html.IndexOf("profile-header");
                                string FirstSubStringForProfileType = html.Substring(FirstPointForProfileType);
                                int SecondPointForProfileType = FirstSubStringForProfileType.IndexOf("class=\"n fn\"");
                                int ThirdPointForProfileType = FirstSubStringForProfileType.IndexOf("</span>");

                                string SecondSubStringForProfileType = FirstSubStringForProfileType.Substring(SecondPointForProfileType, ThirdPointForProfileType - SecondPointForProfileType);
                                string[] tempProfileType = SecondSubStringForProfileType.Split('>');
                                string ProfileType = tempProfileType[1];
                                LDS_ProfileType = ProfileType;
                            }
                            //<h1><span id="name" class="n fn">Private</span>
                            else if (html.Contains(" class=\"n fn\""))
                            {
                                try
                                {
                                    string ProfileTypetemp = html.Substring(html.IndexOf("class=\"n fn\""), 20);
                                    string[] TempProfileType = ProfileTypetemp.Split('>');
                                    LDS_ProfileType = TempProfileType[1].Replace("</strong", "").Replace("</a", "");
                                }
                                catch { }
                            }

                            if (LDS_ProfileType != "Public")
                            {
                                LDS_ProfileType = "Private";
                            }

                        }
                        catch (Exception ex)
                        {
                            Console.WriteLine(ex.Message);
                        }
                        #endregion

                        #region PhonNumber
                        try
                        {
                            if (html.Contains("<dt>Phone:</dt>"))
                            {
                                int FirstPointFortitlepast1 = html.IndexOf("profile-personal");
                                string FirstSubStringFortitlepast1 = html.Substring(FirstPointFortitlepast1);
                                int SecondPointFortitlepast1 = FirstSubStringFortitlepast1.IndexOf("<p>");
                                int ThirdPointFortitlepast1 = FirstSubStringFortitlepast1.IndexOf("<span");

                                string SecondSubStringFortitlepast1 = FirstSubStringFortitlepast1.Substring(SecondPointFortitlepast1, ThirdPointFortitlepast1 - SecondPointFortitlepast1);
                                LDS_UserContactNumber = SecondSubStringFortitlepast1.Replace("<p>", string.Empty);
                            }

                        }
                        catch (Exception ex)
                        {
                            Console.WriteLine(ex.Message);
                        }
                        #endregion

                        xNode = xml.SearchForTag(xBeginSearchAfter, "dt");
                        xBeginSearchAfter = xNode;

                        list.Clear();

                        #endregion

                        #region Regionfor PastCompney
                        try
                        {
                            if (html.Contains("summary-past"))
                            {

                                int FirstPointForPasttitle = html.IndexOf("summary-past");
                                string FirstSubStringForPasttitle = html.Substring(FirstPointForPasttitle);
                                int SecondPointForPasttitle = FirstSubStringForPasttitle.IndexOf("<li>");
                                int ThirdPointForPasttitle = FirstSubStringForPasttitle.IndexOf("summary-education");
                                string SecondSubStringForPasttitle = FirstSubStringForPasttitle.Substring(SecondPointForPasttitle, ThirdPointForPasttitle - SecondPointForPasttitle);
                                string FirstSubStringForPasttitlelast = htmlUtil.EntityDecode(SecondSubStringForPasttitle);

                                htmlToXml1.Html = FirstSubStringForPasttitlelast;
                                xHtml1 = htmlToXml1.ToXml();

                                Chilkat.Xml xml1 = new Chilkat.Xml();
                                xml1.LoadXml(xHtml1);

                                ////  Iterate over all h1 tags:
                                Chilkat.Xml xNode1 = default(Chilkat.Xml);
                                Chilkat.Xml xBeginSearchAfter1 = default(Chilkat.Xml);

                                list.Clear();
                                string[] tempC1 = null;
                                xNode1 = xml1.SearchForTag(xBeginSearchAfter1, "li");

                                while ((xNode1 != null))
                                {
                                    Finaldata = xNode1.AccumulateTagContent("text", "/text");
                                    listtitle.Add(Finaldata);
                                    // list.Add(Finaldata);

                                    try
                                    {
                                        tempC1 = Regex.Split(Finaldata, " at ");
                                    }
                                    catch { }
                                    if (tempC1 != null)
                                    {
                                        try
                                        {
                                            list.Add(tempC1[1]);
                                        }
                                        catch { }

                                    }

                                    xNode1 = xml1.SearchForTag(xBeginSearchAfter1, "li");
                                    xBeginSearchAfter1 = xNode1;
                                }

                                if (listtitle.Count > 0 || list.Count > 0)
                                {
                                    try
                                    {
                                        titlepast1 = listtitle[0] != null ? listtitle[0] : string.Empty;
                                        titlepast2 = listtitle[1] != null ? listtitle[1] : string.Empty;
                                        titlepast3 = listtitle[2] != null ? listtitle[2] : string.Empty;
                                        titlepast4 = listtitle[3] != null ? listtitle[3] : string.Empty;
                                    }
                                    catch { }

                                    try
                                    {
                                        companypast1 = list[0] != null ? list[0] : string.Empty;

                                        companypast2 = list[1] != null ? list[1] : string.Empty;

                                        companypast3 = list[2] != null ? list[2] : string.Empty;

                                        companypast4 = list[3] != null ? list[3] : string.Empty;
                                    }
                                    catch { }
                                }

                            }
                        }
                        catch { };

                        list.Clear();
                        #endregion

                        #region Regionfor summary-current
                        try
                        {
                            if (html.Contains("summary-current"))
                            {

                                int FirstPointForCurrenttitle = html.IndexOf("summary-current");
                                string FirstSubStringForCurrenttitle = html.Substring(FirstPointForCurrenttitle);
                                int SecondPointForCurrenttitle = FirstSubStringForCurrenttitle.IndexOf("<li>");
                                int ThirdPointForCurrenttitle = FirstSubStringForCurrenttitle.IndexOf("summary-past");
                                string SecondSubStringForCurrenttitle = FirstSubStringForCurrenttitle.Substring(SecondPointForCurrenttitle, ThirdPointForCurrenttitle - SecondPointForCurrenttitle);
                                string FirstSubStringForCurrenttitlelast = htmlUtil.EntityDecode(SecondSubStringForCurrenttitle);

                                htmlToXml1.Html = FirstSubStringForCurrenttitlelast;
                                xHtml1 = htmlToXml1.ToXml();

                                Chilkat.Xml xml1 = new Chilkat.Xml();
                                xml1.LoadXml(xHtml1);

                                ////  Iterate over all h1 tags:
                                Chilkat.Xml xNode1 = default(Chilkat.Xml);
                                Chilkat.Xml xBeginSearchAfter1 = default(Chilkat.Xml);

                                Currentlist.Clear();
                                list.Clear();
                                string[] tempC1 = null;
                                xNode1 = xml1.SearchForTag(xBeginSearchAfter1, "li");

                                while ((xNode1 != null))
                                {
                                    Finaldata = xNode1.AccumulateTagContent("text", "/text");
                                    Currentlist.Add(Finaldata);
                                    // list.Add(Finaldata);

                                    try
                                    {
                                        tempC1 = Regex.Split(Finaldata, " at ");
                                    }
                                    catch { }
                                    if (tempC1 != null)
                                    {
                                        try
                                        {
                                            list.Add(tempC1[1]);
                                        }
                                        catch { }

                                    }

                                    xNode1 = xml1.SearchForTag(xBeginSearchAfter1, "li");
                                    xBeginSearchAfter1 = xNode1;
                                }

                                if (Currentlist.Count > 0 || list.Count > 0)
                                {
                                    try
                                    {
                                        titleCurrenttitle = Currentlist[0] != null ? Currentlist[0] : string.Empty;
                                        titleCurrenttitle2 = Currentlist[1] != null ? Currentlist[1] : string.Empty;
                                        titleCurrenttitle3 = Currentlist[2] != null ? Currentlist[2] : string.Empty;
                                        titleCurrenttitle4 = Currentlist[3] != null ? Currentlist[3] : string.Empty;
                                    }
                                    catch { }

                                    try
                                    {
                                        companyCurrenttitle1 = list[0] != null ? list[0] : string.Empty;
                                        companyCurrenttitle2 = list[1] != null ? list[1] : string.Empty;
                                        companyCurrenttitle3 = list[2] != null ? list[2] : string.Empty;
                                        companyCurrenttitle4 = list[3] != null ? list[3] : string.Empty;
                                    }
                                    catch { }
                                }

                            }
                        }
                        catch { };

                        list.Clear();
                        #endregion

                        #region RegionForEDUCATION
                        try
                        {
                            if (html.Contains("summary-education"))
                            {

                                int FirstPointForEDUCATION = html.IndexOf("summary-education");
                                string FirstSubStringForEDUCATION = html.Substring(FirstPointForEDUCATION);
                                int SecondPointForEDUCATION = FirstSubStringForEDUCATION.IndexOf("<li>");
                                int ThirdPointForEDUCATION = FirstSubStringForEDUCATION.IndexOf("</ul>");
                                string SecondSubStringForEDUCATION = FirstSubStringForEDUCATION.Substring(SecondPointForEDUCATION, ThirdPointForEDUCATION - SecondPointForEDUCATION);
                                //string tempEDu = SecondSubStringForEDUCATION.Replace("<li>", string.Empty).Replace("</li>", string.Empty).Replace("  ", string.Empty).Replace("\n", string.Empty).Replace("\t", string.Empty).Trim();
                                string temptg = SecondSubStringForEDUCATION.Replace("<li>", "");

                                string[] templis6t = temptg.Split('/');
                                education1 = templis6t[0].Replace("\n", string.Empty).Replace("\t", string.Empty).Replace("<", string.Empty).Replace("span>", string.Empty).Replace(",", string.Empty).Trim();
                                education2 = templis6t[1].Replace("\n", string.Empty).Replace("\t", string.Empty).Replace("li>", string.Empty).Replace("<", string.Empty).Replace("span>", string.Empty).Replace(",", string.Empty).Trim();
                            }
                        }

                        catch { };

                        list.Clear();
                        #endregion

                        string GroupPastJob = string.Empty;
                        string GroupEduction = string.Empty;
                        LDS_PastTitles = titlepast1 + ";" + titlepast3;
                        LDS_PastCompany = companypast1 + ";" + companypast3;
                        LDS_Education = education1 + ";" + education2;
                        LDS_CurrentTitle = titleCurrenttitle;
                        LDS_LoginID = SearchCriteria.LoginID;                                                                                                                       //"ProfileType" + "," + "UserProfileLink" + "," + "FirstName" + "," + "LastName" + "," + "HeadLineTitle" + "," + "CurrentTitle " + "," + "Company" + "," + "Connection" + "," + "Recommendations " + "," + "SkillAndExpertise " + "," + "Experience " + "," + " Education" + "," + "Groups" + "," + "UserEmail" + "," + "UserContactNumbe" + "," + "PastTitles" + "," + "PastCompany" + "," + "Loction" + "," + "Country" + "," + "titlepast3" + "," + "companypast3" + "," + "titlepast4" + "," + "companypast4" + ",";
                        string LDS_FinalData = LDS_ProfileType.Replace(",", ";") + "," + LDS_UserProfileLink.Replace(",", ";") + "," + LDS_FirstName.Replace(",", ";") + "," + LDS_LastName.Replace(",", ";") + "," + LDS_HeadLineTitle.Replace(",", ";") + "," + LDS_CurrentTitle.Replace(",", ";") + "," + LDS_CurrentCompany.Replace(",", ";") + "," + LDS_Connection.Replace(",", ";") + "," + LDS_Recommendations.Replace(",", ";") + "," + LDS_SkillAndExpertise.Replace(",", ";") + "," + LDS_Experience.Replace(",", ";") + "," + LDS_Education.Replace(",", ";") + "," + LDS_Groups.Replace(",", ";") + "," + LDS_UserEmail.Replace(",", ";") + "," + LDS_UserContactNumber.Replace(",", ";") + "," + LDS_PastTitles.Replace(",", ";") + "," + LDS_PastCompany.Replace(",", ";") + "," + LDS_Loction.Replace(",", ";") + "," + LDS_Country.Replace(",", ";") + "," + LDS_Industry.Replace(",", ";") + "," + LDS_Websites.Replace(",", ";") + "," + LDS_LoginID.Replace(",", ";") + ",";

                        if (LDS_FinalData.Contains("<strong class=\"highlight\"") || LDS_FinalData.Contains("<span class=\"full-name\"") || LDS_FinalData.Contains("<strong class=\"highlight\"") || LDS_FinalData.Contains("overview-connections\">"))
                        {
                            LDS_FinalData = LDS_FinalData.Replace("<span class=\"full-name\"", "").Replace("\n", "").Replace("<strong class=\"highlight\"", "").Replace("overview-connections\">", "").Replace("</strong>", "").Replace("<strong>", "");
                        }
                        if (!string.IsNullOrEmpty(LDS_FirstName) || !string.IsNullOrEmpty(LDS_FirstName))
                        {
                            Log("[ " + DateTime.Now + " ] => [ " + LDS_FinalData + " ]");
                        }
                        if (SearchCriteria.starter)
                        {

                            string tempFinalData = LDS_FinalData.Replace(";", "").Replace(LDS_UserProfileLink, "").Replace("Public", "").Replace(",", "").Replace(LDS_LoginID, "").Trim();

                            if (!string.IsNullOrEmpty(tempFinalData))
                            {
                                AppFileHelper.AddingLinkedInDataToCSVFile(LDS_FinalData, SearchCriteria.FileName);
                                //Log("Data Saved In CSV File With URL >>> " + LDS_UserProfileLink);
                            }

                            //if (!string.IsNullOrEmpty(LDS_FirstName) || !string.IsNullOrEmpty(LDS_FirstName))
                            //{
                            //    AppFileHelper.AddingLinkedInDataToCSVFile(LDS_FinalData, SearchCriteria.FileName);
                            //}
                        }

                    }
                    catch (Exception ex) { };

                }

            }
        }
示例#8
0
        public bool gmail(string Email, string Password)
        {
            GlobusHttpHelper HttpHelper = new GlobusHttpHelper();
            bool activate = false;

            Chilkat.Http http = new Chilkat.Http();

            ///Chilkat Http Request to be used in Http Post...
            Chilkat.HttpRequest req = new Chilkat.HttpRequest();
            bool success;

            // Any string unlocks the component for the 1st 30-days.
            success = http.UnlockComponent("THEBACHttp_b3C9o9QvZQ06");
            if (success != true)
            {
                Console.WriteLine(http.LastErrorText);
                return false;
            }
            http.CookieDir = "memory";
            http.SendCookies = true;
            http.SaveCookies = true;

            //http.ProxyDomain = "127.0.0.1";
            //http.ProxyPort = 8888;

            http.SetRequestHeader("Accept-Encoding", "gzip,deflate");

            if (Email.Contains("@gmail"))
            {
                if (popClient.Connected)
                    popClient.Disconnect();
                popClient.Connect("pop.gmail.com", int.Parse("995"), true);
                popClient.Authenticate(Email, Password);
                int Count = popClient.GetMessageCount();

                for (int i = Count; i >= 1; i--)
                {
                    OpenPOP.MIME.Message Message = popClient.GetMessage(i);

                    string subject = Message.Headers.Subject;

                    if (Message.Headers.Subject.Contains("[WordPress] Activate") && Message.Headers.Subject.Contains("wordpress.com"))
                    {
                        foreach (string href in GetUrlsFromStringGmail(Message.MessageBody[0]))
                        {
                            try
                            {
                                string staticUrl = string.Empty;

                                staticUrl = href;

                                responce = http.QuickGetStr(staticUrl);
                                if (responce.Contains("Your account is now active"))
                                {
                                    Log("[ " + DateTime.Now + " ] => [ Account activated ]");
                                    activate = true;
                                }

                            }
                            catch (Exception ex)
                            {

                            }
                        }
                    }
                }
            }
            return activate;
        }
示例#9
0
        public bool ActivationProcess(string ActivationUrl)
        {
            bool IsActivated = false;

            try
            {
                Chilkat.Http http = new Chilkat.Http();

                ///Chilkat Http Request to be used in Http Post...
                Chilkat.HttpRequest req = new Chilkat.HttpRequest();
                bool success;

                // Any string unlocks the component for the 1st 30-days.
                success = http.UnlockComponent("THEBACHttp_b3C9o9QvZQ06");
                if (success != true)
                {
                    Console.WriteLine(http.LastErrorText);
                }
                http.CookieDir = "memory";
                http.SendCookies = true;
                http.SaveCookies = true;

                http.SetRequestHeader("Accept-Encoding", "gzip,deflate");

                //complete url with website and address
                string siteurl = "http://blog.com/wp-login.php";
                //siteurl = Website;

                //  Send the HTTP GET and return the content in a string.
                string html = null;
                //html = http.QuickGetStr(siteurl);
                string actvateUrl = ActivationUrl.Substring(ActivationUrl.IndexOf("http"));

                html = http.QuickGetStr(actvateUrl);

                if (responce.Contains("Your account is now active"))
                {
                    Log("[ " + DateTime.Now + " ] => [ Account activated ]");
                    IsActivated = true;
                }

                if (!string.IsNullOrEmpty(html))
                {
                    if (html.Contains("Your account is now active") || html.Contains("Back to"))
                    {
                        //                   Log("blog account verified");

                        return true;
                    }
                    else
                    {
                        //                  Log("blog account not verified");
                        return false;
                    }
                }
                else
                {

                }

            }
            catch (Exception ex)
            {

            }

            return IsActivated;
        }
示例#10
0
        public bool GetYahooMails(string yahooEmail, string yahooPassword)
        {
            GlobusHttpHelper HttpHelper = new GlobusHttpHelper();
            bool activate = false;
            try
            {
                bool emaildata = false;

                Chilkat.Http http = new Chilkat.Http();

                ///Chilkat Http Request to be used in Http Post...
                Chilkat.HttpRequest req = new Chilkat.HttpRequest();
                bool success;

                // Any string unlocks the component for the 1st 30-days.
                success = http.UnlockComponent("THEBACHttp_b3C9o9QvZQ06");
                if (success != true)
                {
                    Console.WriteLine(http.LastErrorText);
                    return false;
                }
                http.CookieDir = "memory";
                http.SendCookies = true;
                http.SaveCookies = true;

                //http.ProxyDomain = "127.0.0.1";
                //http.ProxyPort = 8888;

                http.SetRequestHeader("Accept-Encoding", "gzip,deflate");

                Chilkat.Imap iMap = new Imap();
                string Username = yahooEmail;
                string Password = yahooPassword;
                //Username = "******";
                //Password = "******";
                iMap.UnlockComponent("THEBACIMAPMAILQ_OtWKOHoF1R0Q");

                //iMap.
                //iMap.HttpProxyHostname = "127.0.0.1";
                //iMap.HttpProxyPort = 8888;

                iMap.Connect("imap.n.mail.yahoo.com");
                iMap.Login(yahooEmail, yahooPassword);
                iMap.SelectMailbox("Inbox");

                // Get a message set containing all the message IDs
                // in the selected mailbox.
                Chilkat.MessageSet msgSet;
                //msgSet = iMap.Search("FROM \"facebookmail.com\"", true);
                msgSet = iMap.GetAllUids();

                // Fetch all the mail into a bundle object.
                Chilkat.Email email = new Chilkat.Email();
                //bundle = iMap.FetchBundle(msgSet);
                string strEmail = string.Empty;
                List<string> lstData = new List<string>();
                if (msgSet != null)
                {
                    for (int i = msgSet.Count; i > 0; i--)
                    {
                        email = iMap.FetchSingle(msgSet.GetId(i), true);
                        strEmail = email.Subject;
                        string emailHtml = email.GetHtmlBody();
                        lstData.Add(strEmail);

                        if (email.Subject.Contains("[WordPress] Activate") && email.Subject.Contains("wordpress.com"))
                        {
                            foreach (string href in GetUrlsFromString(email.Body))
                            {
                                try
                                {

                                    string staticUrl = string.Empty;

                                    staticUrl = href;
                                    responce = http.QuickGetStr(staticUrl);

                                    if (responce.Contains("Your account is now active"))
                                    {
                                        emaildata = true;
                                        //Log("your Account is activate now");
                                        activate = true;
                                    }
                                }
                                catch (Exception ex)
                                {
                                    Console.WriteLine(ex.StackTrace);
                                }
                            }
                        }
                    }
                }
                if (emaildata == false)
                {
                    Log("[ " + DateTime.Now + " ] => [ activation link is not find in user account so your Account is not activate please activate now ]");
                }
            }
            catch (Exception ex)
            {
            }
            return activate;
        }
示例#11
0
        public bool EmailVerification(string Email, string Password, ref GlobusHttpHelper globushttpHelper)
        {
            bool IsActivated = false;
            try
            {
                Log("[ " + DateTime.Now + " ] => [ Please Wait Account Verification Start... ]");

                System.Windows.Forms.Application.DoEvents();
                Chilkat.Http http = new Chilkat.Http();

                if (Email.Contains("@yahoo"))
                {
                    #region Yahoo Verification Steps

                    GlobusHttpHelper HttpHelper = new GlobusHttpHelper();
                    bool activate = false;
                    try
                    {
                        bool emaildata = false;
                        //Chilkat.Http http = new Chilkat.Http();
                        ///Chilkat Http Request to be used in Http Post...
                        Chilkat.HttpRequest req = new Chilkat.HttpRequest();
                        bool success;

                        // Any string unlocks the component for the 1st 30-days.
                        success = http.UnlockComponent("THEBACHttp_b3C9o9QvZQ06");
                        if (success != true)
                        {
                            Console.WriteLine(http.LastErrorText);
                            return false;
                        }

                        http.CookieDir = "memory";
                        http.SendCookies = true;
                        http.SaveCookies = true;

                        //http.ProxyDomain = "127.0.0.1";
                        //http.ProxyPort = 8888;
                        http.SetRequestHeader("Accept-Encoding", "gzip,deflate");
                        Chilkat.Imap iMap = new Imap();
                        string Username = Email;

                        iMap.UnlockComponent("THEBACIMAPMAILQ_OtWKOHoF1R0Q");
                        //iMap.
                        //iMap.HttpProxyHostname = "127.0.0.1";
                        //iMap.HttpProxyPort = 8888;

                        iMap.Port = 993;
                        iMap.Connect("imap.n.mail.yahoo.com");
                        iMap.Login(Email, Password);
                        iMap.SelectMailbox("Inbox");

                        // Get a message set containing all the message IDs
                        // in the selected mailbox.
                        Chilkat.MessageSet msgSet;
                        //msgSet = iMap.Search("FROM \"facebookmail.com\"", true);

                        msgSet = iMap.GetAllUids();

                        if (msgSet.Count <= 0)
                        {
                            msgSet = iMap.GetAllUids();
                        }

                        // Fetch all the mail into a bundle object.
                        Chilkat.Email email = new Chilkat.Email();
                        //bundle = iMap.FetchBundle(msgSet);
                        string strEmail = string.Empty;
                        List<string> lstData = new List<string>();
                        if (msgSet != null)
                        {
                            for (int i = 0; i < msgSet.Count; i++)
                            {
                                try
                                {
                                    email = iMap.FetchSingle(msgSet.GetId(i), true);
                                    strEmail = email.Subject;
                                    string emailHtml = email.GetHtmlBody();
                                    lstData.Add(strEmail);

                                    string from = email.From.ToString().ToLower();

                                    if (from.Contains("@linkedin.com"))
                                    {
                                        foreach (string href in GetUrlsFromString(email.Body))
                                        {
                                            try
                                            {

                                                if (href.Contains("http://www.linkedin.com/e/csrf") || href.Contains("http://www.linkedin.com/e/ato") || href.Contains("http://www.linkedin.com/e/v2?e"))
                                                {
                                                    string EscapeEmail = Uri.EscapeDataString(Email).Replace(".", "%2E").Trim();
                                                    {
                                                        string ConfirmationResponse = globushttpHelper.getHtmlfromUrl1(new Uri(href));
                                                        IsActivated = true;
                                                        break;
                                                    }

                                                }

                                            }
                                            catch (Exception ex)
                                            {
                                                Console.WriteLine("6 :" + ex.StackTrace);
                                            }
                                        }
                                    }
                                    if (IsActivated)
                                    {
                                        Log("[ " + DateTime.Now + " ] => [ Account : " + Email + " verified ]");
                                        break;
                                    }
                                }
                                catch (Exception ex)
                                {
                                    Console.WriteLine("Error >>> " + ex.StackTrace);
                                }
                            }
                        }

                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine("7 :" + ex.StackTrace);
                        Log("[ " + DateTime.Now + " ] => [ Email Verification Exception : " + ex.Message + "StackTrace --> >>>" + ex.StackTrace + " with : " + Email + " ]");
                        Log("[ " + DateTime.Now + " ] => [ Please check your Login Id and Password ]");
                    }
                    return IsActivated;
                    #endregion
                }
                else
                {
                    string Host = string.Empty;
                    int Port = 0;
                    if (Email.Contains("@gmail"))
                    {
                        Host = "pop.gmail.com";
                        Port = 995;
                    }
                    else if (Email.Contains("@hotmail"))
                    {
                        Host = "pop3.live.com";
                        Port = 995;
                    }
                    else if (Email.Contains("@gmx"))
                    {
                        Host = "pop.gmx.com";
                        Port = 995;
                    }
                    if (!string.IsNullOrEmpty(Host))
                    {
                        try
                        {
                            if (popClient.Connected)
                                popClient.Disconnect();
                            popClient.Connect(Host, Port, true);
                            popClient.Authenticate(Email, Password);
                        }
                        catch (Exception ex)
                        {
                            Console.WriteLine(ex.StackTrace);

                            //retry once
                            System.Threading.Thread.Sleep(1000);

                            if (popClient.Connected)
                                popClient.Disconnect();
                            popClient.Connect(Host, Port, true);
                            popClient.Authenticate(Email, Password);
                        }

                        //if (!)
                        //{

                        //}

                        int Count = popClient.GetMessageCount();

                        for (int i = Count; i >= 1; i--)
                        {
                            try
                            {
                                OpenPOP.MIME.Message Message = popClient.GetMessage(i);
                                string subject = string.Empty;
                                subject = Message.Headers.Subject;
                                string frowwm = Message.Headers.From.ToString();
                                bool GoIntoEmail = false;

                                if (string.IsNullOrEmpty(subject))
                                {
                                    string from = Message.Headers.From.ToString().ToLower();
                                    if (from.Contains("linkedin.com"))
                                    {
                                        GoIntoEmail = true;
                                    }
                                }
                                try
                                {
                                    if (frowwm.Contains("linkedin.com"))
                                    //if(GoIntoEmail)
                                    {
                                        string Messagebody = Message.MessageBody[0];

                                        foreach (string href in GetUrlsFromStringGmail(Messagebody))
                                        {
                                            try
                                            {
                                                if (href.Contains("http://www.linkedin.com/e/csrf") || href.Contains("http://www.linkedin.com/e/ato") || href.Contains("http://www.linkedin.com/e/v2?e"))
                                                {
                                                  string  href1 = href.Replace("amp;",string.Empty);
                                                    string EscapeEmail = Uri.EscapeDataString(Email).Replace(".", "%2E").Trim();
                                                    {
                                                        string ConfirmationResponse = globushttpHelper.getHtmlfromUrl1(new Uri(href1));
                                                        IsActivated = true;
                                                        break;
                                                    }
                                                }
                                            }
                                            catch (Exception ex)
                                            {
                                                Console.WriteLine("5 :" + ex.StackTrace);
                                            };
                                        }
                                    }
                                }
                                catch (Exception ex)
                                {
                                    Console.WriteLine("10 :" + ex.StackTrace);
                                    Log("[ " + DateTime.Now + " ] => [ Email Verification Exception : " + ex.Message + "StackTrace --> >>>" + ex.StackTrace + " with : " + Email + " ]");
                                }
                                if (IsActivated)
                                {

                                    break;
                                }
                            }
                            catch (Exception ex)
                            {
                                {
                                    Log("[ " + DateTime.Now + " ] => [ Email Verification Exception : " + ex.Message + "StackTrace --> >>>" + ex.StackTrace + " with : " + Email + " ]");
                                    Log("[ " + DateTime.Now + " ] => [ Please check your Login Id and Password ]");
                                }
                            }
                        }
                    }
                }
                return IsActivated;
            }
            catch (Exception ex)
            {
                Console.WriteLine("4 :" + ex.StackTrace);
                return IsActivated;
            }
        }
示例#12
0
        public bool EmailVerification(string Email, string Password, ref GlobusHttpHelper globushttpHelper)
        {
            bool IsActivated = false;

            try
            {
                System.Windows.Forms.Application.DoEvents();
                Chilkat.Http http = new Chilkat.Http();

                if (Email.Contains("+"))
                {
                    String[] emaildata = Email.Split('+');
                    Email = (emaildata[0] + "@" + emaildata[1].Split('@')[1]).Trim();
                }

                if (Email.Contains("@yahoo"))
                {
                    #region Yahoo Verification Steps

                    GlobusHttpHelper HttpHelper = new GlobusHttpHelper();
                    bool             activate   = false;
                    try
                    {
                        bool emaildata = false;
                        //Chilkat.Http http = new Chilkat.Http();
                        ///Chilkat Http Request to be used in Http Post...
                        Chilkat.HttpRequest req = new Chilkat.HttpRequest();
                        bool success;

                        // Any string unlocks the component for the 1st 30-days.
                        success = http.UnlockComponent("THEBACHttp_b3C9o9QvZQ06");
                        if (success != true)
                        {
                            Console.WriteLine(http.LastErrorText);
                            return(false);
                        }
                        http.CookieDir   = "memory";
                        http.SendCookies = true;
                        http.SaveCookies = true;

                        //http.IPDomain = "127.0.0.1";
                        //http.IPPort = 8888;
                        http.SetRequestHeader("Accept-Encoding", "gzip,deflate");
                        Chilkat.Imap iMap     = new Imap();
                        string       Username = Email;

                        iMap.UnlockComponent("THEBACIMAPMAILQ_OtWKOHoF1R0Q");
                        //iMap.
                        //iMap.HttpIPHostname = "127.0.0.1";
                        //iMap.HttpIPPort = 8888;
                        iMap.Port = 993;
                        iMap.Connect("imap.n.mail.yahoo.com");
                        iMap.Login(Email, Password);
                        iMap.SelectMailbox("Inbox");

                        // Get a message set containing all the message IDs
                        // in the selected mailbox.
                        Chilkat.MessageSet msgSet;
                        //msgSet = iMap.Search("FROM \"facebookmail.com\"", true);
                        msgSet = iMap.GetAllUids();

                        if (msgSet.Count <= 0)
                        {
                            msgSet = iMap.GetAllUids();
                        }

                        // Fetch all the mail into a bundle object.
                        Chilkat.Email email = new Chilkat.Email();
                        //bundle = iMap.FetchBundle(msgSet);
                        string        strEmail = string.Empty;
                        List <string> lstData  = new List <string>();
                        if (msgSet != null)
                        {
                            for (int i = msgSet.Count; i > 0; i--)
                            //for (int i = 0; i < msgSet.Count; i++)
                            {
                                try
                                {
                                    email    = iMap.FetchSingle(msgSet.GetId(i), true);
                                    strEmail = email.Subject;
                                    string emailHtml = email.GetHtmlBody();
                                    lstData.Add(strEmail);

                                    string from = email.From.ToString().ToLower();

                                    if (from.Contains("twitter.com") || from.Contains("account-verification"))
                                    {
                                        #region <old User Parser
                                        //foreach (string href in GetUrlsFromString(email.Body))
                                        //{
                                        //    try
                                        //    {
                                        //        if (href.Contains("https://twitter.com/account/confirm_email/") )
                                        //        {
                                        //            string ConfirmationResponse = globushttpHelper.getHtmlfromUrl(new Uri(href), "", "");
                                        //            IsActivated = true;
                                        //        }

                                        //    }
                                        //    catch (Exception ex)
                                        //    {
                                        //        Console.WriteLine("6 :" + ex.StackTrace);
                                        //    }
                                        //}

                                        #endregion

                                        string[] arr = Regex.Split(email.Body, "href");

                                        foreach (string strhref in arr)
                                        {
                                            if (!strhref.Contains("<!DOCTYPE"))
                                            {
                                                if (strhref.Contains("https://twitter.com/account/confirm_email"))
                                                {
                                                    string AncherTag            = System.Text.RegularExpressions.Regex.Split(strhref, ">")[1];
                                                    string tempString           = AncherTag.Substring(AncherTag.IndexOf("https"));
                                                    string DataUrl              = tempString.Replace("<>", "").Replace(">", string.Empty).Replace("\r", string.Empty).Replace("\n", string.Empty).Replace("</a", string.Empty);
                                                    string ConfirmationResponse = globushttpHelper.getHtmlfromUrl(new Uri(DataUrl), "", "");
                                                    IsActivated = true;
                                                    break;
                                                }
                                            }
                                        }
                                    }
                                    if (IsActivated)
                                    {
                                        Log("[ " + DateTime.Now + " ] => [ Account : " + Email + " verified ]");
                                        break;
                                    }
                                }
                                catch { };
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine("7 :" + ex.StackTrace);
                        Log("[ " + DateTime.Now + " ] => [ Email Verification Exception : " + ex.Message + " with : " + Email + " ]");
                    }
                    return(IsActivated);

                    #endregion
                }
                else
                {
                    string Host = string.Empty;
                    int    Port = 0;
                    if (Email.Contains("@gmail"))
                    {
                        Host = "pop.gmail.com";
                        Port = 995;
                    }
                    else if (Email.Contains("@hotmail"))
                    {
                        Host = "pop3.live.com";
                        Port = 995;
                    }
                    else if (Email.Contains("@gmx"))
                    {
                        Host = "pop.gmx.com";
                        Port = 995;
                    }
                    if (!string.IsNullOrEmpty(Host))
                    {
                        if (popClient.Connected)
                        {
                            popClient.Disconnect();
                        }
                        popClient.Connect(Host, Port, true);
                        popClient.Authenticate(Email, Password);
                        int Count = popClient.GetMessageCount();

                        for (int i = Count; i >= 1; i--)
                        {
                            try
                            {
                                OpenPOP.MIME.Message Message = popClient.GetMessage(i);
                                string subject = string.Empty;
                                subject = Message.Headers.Subject;

                                bool GoIntoEmail = false;

                                if (string.IsNullOrEmpty(subject))
                                {
                                    string from = Message.Headers.From.ToString().ToLower();
                                    if (from.Contains("twitter.com"))
                                    {
                                        GoIntoEmail = true;
                                    }
                                }
                                try
                                {
                                    if (GoIntoEmail || subject.Contains("Twitter"))
                                    //if(GoIntoEmail)
                                    {
                                        string Messagebody = Message.MessageBody[0];

                                        foreach (string href in GetUrlsFromStringGmail(Messagebody))
                                        {
                                            try
                                            {
                                                if (href.Contains("https://twitter.com/account/confirm_email/"))
                                                {
                                                    string ConfirmationResponse = globushttpHelper.getHtmlfromUrl(new Uri(href), "", "");
                                                    IsActivated = true;
                                                    break;
                                                }
                                            }
                                            catch (Exception ex)
                                            {
                                                Console.WriteLine("5 :" + ex.StackTrace);
                                            };
                                        }
                                    }
                                }
                                catch (Exception ex)
                                {
                                    Console.WriteLine("10 :" + ex.StackTrace);
                                    Log("[ " + DateTime.Now + " ] => [ Email Verification Exception : " + ex.Message + " with : " + Email + " ]");
                                }
                                if (IsActivated)
                                {
                                    break;
                                }
                            }
                            catch (Exception ex)
                            {
                                Log("[ " + DateTime.Now + " ] => [ Email Verification Exception : " + ex.Message + " with : " + Email + " ]");
                            }
                        }
                    }
                }
                return(IsActivated);
            }
            catch (Exception ex)
            {
                Console.WriteLine("4 :" + ex.StackTrace);
                return(IsActivated);
            }
        }
示例#13
0
        public bool EmailVerification(string Email, string Password, ref GlobusHttpHelper globushttpHelper)
        {
            bool IsActivated = false;
            try
            {
                System.Windows.Forms.Application.DoEvents();
                Chilkat.Http http = new Chilkat.Http();

                if (Email.Contains("+"))
                {
                    String[] emaildata = Email.Split('+');
                    Email = (emaildata[0] +"@" +emaildata[1].Split('@')[1]).Trim();
                }

                if (Email.Contains("@yahoo"))
                {
                    #region Yahoo Verification Steps

                    GlobusHttpHelper HttpHelper = new GlobusHttpHelper();
                    bool activate = false;
                    try
                    {
                        bool emaildata = false;
                        //Chilkat.Http http = new Chilkat.Http();
                        ///Chilkat Http Request to be used in Http Post...
                        Chilkat.HttpRequest req = new Chilkat.HttpRequest();
                        bool success;

                        // Any string unlocks the component for the 1st 30-days.
                        success = http.UnlockComponent("THEBACHttp_b3C9o9QvZQ06");
                        if (success != true)
                        {
                            Console.WriteLine(http.LastErrorText);
                            return false;
                        }
                        http.CookieDir = "memory";
                        http.SendCookies = true;
                        http.SaveCookies = true;

                        //http.IPDomain = "127.0.0.1";
                        //http.IPPort = 8888;
                        http.SetRequestHeader("Accept-Encoding", "gzip,deflate");
                        Chilkat.Imap iMap = new Imap();
                        string Username = Email;

                        iMap.UnlockComponent("THEBACIMAPMAILQ_OtWKOHoF1R0Q");
                        //iMap.
                        //iMap.HttpIPHostname = "127.0.0.1";
                        //iMap.HttpIPPort = 8888;
                        iMap.Port = 993;
                        iMap.Connect("imap.n.mail.yahoo.com");
                        iMap.Login(Email, Password);
                        iMap.SelectMailbox("Inbox");

                        // Get a message set containing all the message IDs
                        // in the selected mailbox.
                        Chilkat.MessageSet msgSet;
                        //msgSet = iMap.Search("FROM \"facebookmail.com\"", true);
                        msgSet = iMap.GetAllUids();

                        if (msgSet.Count <= 0)
                        {
                            msgSet = iMap.GetAllUids();
                        }

                        // Fetch all the mail into a bundle object.
                        Chilkat.Email email = new Chilkat.Email();
                        //bundle = iMap.FetchBundle(msgSet);
                        string strEmail = string.Empty;
                        List<string> lstData = new List<string>();
                        if (msgSet != null)
                        {
                            for (int i = msgSet.Count; i > 0; i--)
                            //for (int i = 0; i < msgSet.Count; i++)
                            {
                                try
                                {
                                    email = iMap.FetchSingle(msgSet.GetId(i), true);
                                    strEmail = email.Subject;
                                    string emailHtml = email.GetHtmlBody();
                                    lstData.Add(strEmail);

                                    string from = email.From.ToString().ToLower();

                                    if (from.Contains("twitter.com") || from.Contains("account-verification"))
                                    {
                                        #region <old User Parser
                                        //foreach (string href in GetUrlsFromString(email.Body))
                                        //{
                                        //    try
                                        //    {
                                        //        if (href.Contains("https://twitter.com/account/confirm_email/") )
                                        //        {
                                        //            string ConfirmationResponse = globushttpHelper.getHtmlfromUrl(new Uri(href), "", "");
                                        //            IsActivated = true;
                                        //        }

                                        //    }
                                        //    catch (Exception ex)
                                        //    {
                                        //        Console.WriteLine("6 :" + ex.StackTrace);
                                        //    }
                                        //}

                                        #endregion

                                        string[] arr = Regex.Split(email.Body, "href");
                                     
                                        foreach (string strhref in arr)
                                        {
                                            if (!strhref.Contains("<!DOCTYPE"))
                                            {
                                                if (strhref.Contains("https://twitter.com/account/confirm_email"))
                                                {
                                                    string AncherTag = System.Text.RegularExpressions.Regex.Split(strhref, ">")[1];
                                                    string tempString = AncherTag.Substring(AncherTag.IndexOf("https"));
                                                    string DataUrl = tempString.Replace("<>", "").Replace(">", string.Empty).Replace("\r", string.Empty).Replace("\n", string.Empty).Replace("</a", string.Empty);
                                                    string ConfirmationResponse = globushttpHelper.getHtmlfromUrl(new Uri(DataUrl), "", "");
                                                    IsActivated = true;
                                                    break;
                                                }
                                               
                                            }
                                        }
                                    }
                                    if (IsActivated)
                                    {
                                        Log("[ " + DateTime.Now + " ] => [ Account : " + Email + " verified ]");
                                        break;
                                    }
                                }
                                catch { };
                            }
                        }

                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine("7 :" + ex.StackTrace);
                        Log("[ " + DateTime.Now + " ] => [ Email Verification Exception : " + ex.Message + " with : " + Email + " ]");
                    }
                    return IsActivated;
                    #endregion
                }
                else
                {
                    string Host = string.Empty;
                    int Port = 0;
                    if (Email.Contains("@gmail"))
                    {
                        Host = "pop.gmail.com";
                        Port = 995;
                    }
                    else if (Email.Contains("@hotmail"))
                    {
                        Host = "pop3.live.com";
                        Port = 995;
                    }
                    else if (Email.Contains("@gmx"))
                    {
                        Host = "pop.gmx.com";
                        Port = 995;
                    }
                    if (!string.IsNullOrEmpty(Host))
                    {
                        if (popClient.Connected)
                            popClient.Disconnect();
                        popClient.Connect(Host, Port, true);
                        popClient.Authenticate(Email, Password);
                        int Count = popClient.GetMessageCount();

                        for (int i = Count; i >= 1; i--)
                        {
                            try
                            {
                                OpenPOP.MIME.Message Message = popClient.GetMessage(i);
                                string subject = string.Empty;
                                subject = Message.Headers.Subject;

                                bool GoIntoEmail = false;

                                if (string.IsNullOrEmpty(subject))
                                {
                                    string from = Message.Headers.From.ToString().ToLower();
                                    if (from.Contains("twitter.com"))
                                    {
                                        GoIntoEmail = true;
                                    }
                                }
                                try
                                {
                                    if (GoIntoEmail || subject.Contains("Twitter"))
                                    //if(GoIntoEmail)
                                    {
                                        string Messagebody = Message.MessageBody[0];

                                        foreach (string href in GetUrlsFromStringGmail(Messagebody))
                                        {
                                            try
                                            {
                                                if (href.Contains("https://twitter.com/account/confirm_email/"))
                                                {
                                                    string ConfirmationResponse = globushttpHelper.getHtmlfromUrl(new Uri(href), "", "");
                                                    IsActivated = true;
                                                    break;
                                                }
                                            }
                                            catch (Exception ex)
                                            {
                                                Console.WriteLine("5 :" + ex.StackTrace);
                                            };
                                        }
                                    }
                                }
                                catch (Exception ex)
                                {
                                    Console.WriteLine("10 :" + ex.StackTrace);
                                    Log("[ " + DateTime.Now + " ] => [ Email Verification Exception : " + ex.Message + " with : " + Email + " ]");
                                }
                                if (IsActivated)
                                {

                                    break;
                                }
                            }
                            catch (Exception ex)
                            {
                                Log("[ " + DateTime.Now + " ] => [ Email Verification Exception : " + ex.Message + " with : " + Email + " ]");
                            }
                        }
                    }
                }
                return IsActivated;
            }
            catch (Exception ex)
            {
                Console.WriteLine("4 :" + ex.StackTrace);
                return IsActivated;
            }
        }