Exemple #1
0
 private void StartByClick(bool isByOss = false)
 {
     if (string.IsNullOrEmpty(cookies))
         cookies = this.webView.Document.Cookie;
     if (speed28 == null)
     {
         speed28 = new Speed28(cookies);
         speed28.StateChanged += speed28_StateChanged;
     }
     isStarted = true;
     NavigateToSpeed28();
     this.isSupportOssRule = chkOss.Checked;
     StartRound(isByOss);
 }
Exemple #2
0
        private void CheckLogin()
        {
            if (this.webView.Document == null || this.webView.Document.Body == null ||
                string.IsNullOrEmpty(this.webView.Document.Body.InnerText))
            {
                return;
            }
            cookies = this.webView.Document.Cookie;
            if (!string.IsNullOrEmpty(cookies))
            {
                speed28 = new Speed28(cookies);
                speed28.StateChanged += speed28_StateChanged;
            }

            string htmlBody = this.webView.Document.Body.InnerText;
            if (!isLogined)
            {
                var userItem = this.webView.Document.GetElementById("loginUser");
                if (userItem != null)
                    userItem.SetAttribute("value", txtUser.Text);

                var pwdItem = this.webView.Document.GetElementById("loginPwd");
                if (pwdItem != null)
                    pwdItem.SetAttribute("value", txtPwd.Text);

                if (!isLogined &&
                    (htmlBody.Contains("ID:") || htmlBody.Contains("签到") || htmlBody.Contains("会员中心") ||
                     htmlBody.Contains("当前U币")))
                {
                    isLogined = true;
                    NavigateToSpeed28();
                }
            }

            if (string.IsNullOrEmpty(txtRoundId.Text) && htmlBody.Contains("离竞猜截止时间"))
            {
                string id = GetLatestRoundId();
                if (!string.IsNullOrEmpty((id)))
                {
                    txtRoundId.Text = id;
                }
                GetCurrentBeans();
            }
        }