예제 #1
0
        public bool GetReupInfoRentPubg()
        {
again:
            try
            {
                System.Threading.Thread.Sleep(100);
                ///html/body
                string idAccount = "";
                string idSteam   = "";
                string pwSteam   = "";
                string npwSteam  = "";

                string[] tmp            = rentpubg.FindElement(By.XPath("/html/body/div[3]/div/div/div/h4[1]")).Text.Split(new char[] { ' ' });
                int      quantityOfReup = int.Parse(tmp[0]);


                for (int i = 1; i <= quantityOfReup; i++)
                {
                    idAccount = rentpubg.FindElement(By.XPath("/html/body/div[3]/div/div/div/div[2]/table/tbody/tr[" + i.ToString() + "]/td[6]/button[1]")).GetAttribute("data-id").ToString();
                    idSteam   = rentpubg.FindElement(By.XPath("/html/body/div[3]/div/div/div/div[2]/table/tbody/tr[" + i.ToString() + "]/td[2]/span")).Text;
                    if (skipList.Contains(idSteam))
                    {
                        continue;
                    }

                    for (int j = 0; j < 13 * ((i - 1) / 10); j++)
                    {
                        rentpubg.FindElement(By.XPath("/html/body")).SendKeys(OpenQA.Selenium.Keys.Down);
                    }

                    pwSteam  = rentpubg.FindElement(By.XPath("/html/body/div[3]/div/div/div/div[2]/table/tbody/tr[" + i.ToString() + "]/td[3]/span")).Text;
                    npwSteam = rentpubg.FindElement(By.XPath("/html/body/div[3]/div/div/div/div[2]/table/tbody/tr[" + i.ToString() + "]/td[4]/span")).Text;

                    // nếu có pass từ list thì lấy pass từ list
                    for (int index = 0; index < idList.Count; index++)
                    {
                        if (idList[index] == idSteam)
                        {
                            pwSteam = pwList[index];
                            break;
                        }
                    }
                    account = new CAccount(idRentAcc, idEmail, pwEmail);
                    Console.WriteLine(idSteam + " " + pwSteam + " " + npwSteam);
                    account.SetReupInfo(idAccount, idSteam, pwSteam, npwSteam);
                    return(true);
                }
                skipList.Clear();
                return(false);
            }
            catch (Exception error)
            {
                string log = String.Format("{0:dd/MM/yyyy HH:mm:ss}", DateTime.Now) + ". Error: " + error.ToString() + "\r\n" + account.GetInfo() + "\r\n";
                WriteBugLog(log);
                goto again;
            }
        }
예제 #2
0
 public CAccount(CAccount acc)
 {
     this.idAccount = acc.idAccount;
     this.idSteam   = acc.idSteam;
     this.pwSteam   = acc.pwSteam;
     this.npwSteam  = acc.npwSteam;
     this.idEmail   = acc.idEmail;
     this.pwEmail   = acc.pwEmail;
 }