Esempio n. 1
0
        public void TestFetchEmail()
        {
            email.GetEmailAddress();
            email.CheckEmail();
            Email selectemail = email.FetchEmail(email.Emails.FirstOrDefault().MailId);

            Assert.IsNotNull(selectemail.MailId);
        }
Esempio n. 2
0
 public Email GetEmail(int id)
 {
     return(_mailbox.FetchEmail(id));
 }
Esempio n. 3
0
        public void chrome(int ii)
        {
            GuerrillaMail guerrilla = new GuerrillaMail();

            guerrilla.GetEmailAddress();



            Random number     = new Random();
            string sdt        = "09" + number.Next(10000000, 99999999);
            string passrandom = NgauNhienName().ToLower() + number.Next(10000, 99999) + "@";
            string mail       = guerrilla.EmailAddress;
            string ggkey      = "6LdKwvcUAAAAAOWHayxQNHnDrDVL6GWC-lx1EP0R";
            string CaptchaURL = "https://neebanker.neebank.com/auth/signup?ref=bootm4v";
            var    usename    = NgauNhienName() + number.Next(0, 999999) + ii;
            var    email      = guerrilla.EmailAddress;



            ChromeDriverService service = ChromeDriverService.CreateDefaultService();

            service.HideCommandPromptWindow = true;

            //var options = new ChromeOptions();
            //options.AddArgument("--start - maximized");

            var chromeDriver = new ChromeDriver(service);

            chromeDriver.Url = textBox1.Text;
            chromeDriver.Navigate();
            try
            {
                Thread.Sleep(10000);
                chromeDriver.FindElementByCssSelector("#id_username").SendKeys(usename);
            }
            catch
            {
                chromeDriver.Navigate().Refresh();
                chromeDriver.FindElementByCssSelector("#id_username").SendKeys(usename);;
            }
            string captchaOut = Reslove2CaptchaCaptcha(textBox5.Text, ggkey, CaptchaURL);

            chromeDriver.FindElementByCssSelector("#CountryCode > option:nth-child(233)").Click();
            chromeDriver.FindElementByCssSelector("#userPhone").SendKeys(sdt);
            chromeDriver.FindElementByCssSelector("#id_email").SendKeys(email);
            chromeDriver.FindElementByCssSelector("#id_password1").SendKeys(passrandom);
            chromeDriver.FindElementByCssSelector("#id_password2").SendKeys(passrandom);
            chromeDriver.FindElementByCssSelector("#signupform > div.form-group > div.custom-control.custom-checkbox.d-flex.justify-content-start.text-white > label").Click();

            chromeDriver.ExecuteScript("document.getElementById(\"g-recaptcha-response\").innerHTML=\"" + captchaOut + "\"");
            chromeDriver.FindElementByCssSelector("#signup-btn > span").Click();
            Thread.Sleep(15000);
            chromeDriver.ExecuteScript("document.getElementsByClassName('confirm btn btn-lg btn-success')[0].click();");

            //chromeDriver.FindElementByCssSelector("body > div.sweet-alert.showSweetAlert.visible > div.sa-button-container > div > button").Click();



            guerrilla.CheckEmail();



            if (guerrilla.EmailCount == 0)
            {
                Thread.Sleep(15000);
                guerrilla.CheckEmail();
                if (guerrilla.EmailCount == 0)
                {
                    guerrilla.CheckEmail();
                    Thread.Sleep(15000);
                    guerrilla.CheckEmail();
                }
            }
            if (guerrilla.EmailCount > 0)
            {
                Email emails = guerrilla.FetchEmail(guerrilla.Emails[0].MailId);

                string url   = emails.MailBody;
                var    aaaa2 = url.Substring(url.IndexOf("bold"), 13);
                Thread.Sleep(3000);
                var code = aaaa2.Split('>')[1];
                chromeDriver.FindElementByCssSelector("#TwoFaCode").SendKeys(code);
                chromeDriver.FindElementByCssSelector("#otp-activation-btn").Click();
                Thread.Sleep(3000);
            }
        }