Ejemplo n.º 1
0
        private double GetDragBtuttonElLeft(IWebElement dragBtuttonEl)
        {
            string drBtLeft = dragBtuttonEl.GetAttribute("style");
            string leftstr  = HelperText.getMiddleStr(drBtLeft, "left:", "px", 0);

            return(leftstr.ToDouble(0));
        }
Ejemplo n.º 2
0
        protected void GetCookiesAndSaveToDb(HyAccount account)
        {
            string str;

            Console.Title = string.Concat("取cookie ", Console.Title);
            string cookiesStr = SelementHelper.GetCookiesSmallStr(this.HySeleniumMgr.WebDriver);

            if ((cookiesStr != null ? cookiesStr.IndexOf("udb_biztoken") == -1 : false))
            {
                account.WebCookie = account.WebCookie ?? cookiesStr;
            }
            else
            {
                account.LoginSucceed = true;
                account.Uid          = HelperText.getMiddleStr(string.Concat(cookiesStr, ";"), "yyuid=", ";", 0).ToLong((long)0);
                string middleStr = HelperText.getMiddleStr(string.Concat(cookiesStr, ";"), "guid=", ";", 0);
                if (middleStr != null)
                {
                    str = middleStr.Trim();
                }
                else
                {
                    str = null;
                }
                account.Guid      = str ?? account.Guid;
                account.WebCookie = cookiesStr ?? account.WebCookie;
                XTrace.WriteLine(string.Concat(account.UserName, " ", account.UserPass, " 有登录成功状态"));
            }
            account.Save();
        }