Ejemplo n.º 1
0
        private void Login()
        {
            GeckoInputElement  username = null;
            GeckoInputElement  password = null;
            GeckoButtonElement signIn   = null;

            if (Browser.Document.GetElementsByName("username").Count() > 0)
            {
                username = Browser.Document.GetElementsByName("username")[0] as GeckoInputElement;
            }
            if (Browser.Document.GetElementsByName("password").Count() > 0)
            {
                password = Browser.Document.GetElementsByName("password")[0] as GeckoInputElement;
            }
            if (Browser.Document.GetElementsByClassName("styles__SignInButton-dSRDTk").Count() > 0)
            {
                signIn = Browser.Document.GetElementsByClassName("styles__SignInButton-dSRDTk")[0] as GeckoButtonElement;
            }

            if (username != null && password != null && signIn != null)
            {
                Browser.Focus();

                username.Click();
                username.Focus();
                username.Value = txt_Username.Text;
                password.Click();
                password.Focus();
                password.Value = txt_Password.Text;
                SendKeys.SendWait("\t");
                SendKeys.SendWait("\n");
            }
        }
Ejemplo n.º 2
0
        public void Start()
        {
            //Hide radiobuttons and checkboxes
            pandu.Hide();
            ponly.Hide();
            incDate.Hide();
            paranthesiscbx.Hide();
            includeGameFolders.Hide();

            incscreenshots.Hide();
            dntscreenshots.Hide();

            //Login

            geckoWebBrowser.Document.GetElementById("login_urlname").SetAttribute("value", usernametb.Text);
            geckoWebBrowser.Document.GetElementById("login_pwd").SetAttribute("value", passwordtb.Text);
            GeckoButtonElement button = new GeckoButtonElement(geckoWebBrowser.Document.GetElementsByClassName("btn")[1].DomObject);

            button.Click();


            //Hide remaining elements
            Downloadbtn.Hide();
            usernametb.Hide();
            passwordtb.Hide();
            usernamelbl.Hide();
            passwordlbl.Hide();
            folderpicker.Hide();
            rbUD.Hide();
            rbName.Hide();

            //Show loading circle
            loadingind.Show();

            //Starting to load videos
            Load1SiteAsync();
        }
Ejemplo n.º 3
0
        public override int LogIn()
        {
            Navigate_Client(login_path);
            string body = Document.Body.InnerHtml;

            GeckoInputElement username_TextBox = new GeckoInputElement(Document.GetElementById("username").DomObject);

            username_TextBox.Value = "piotex";
            GeckoInputElement pwd_TextBox = new GeckoInputElement(Document.GetElementById("password").DomObject);

            pwd_TextBox.Value = "start12345";

            IsCompleted();

            GeckoButtonElement button = new GeckoButtonElement(Document.GetElementsByClassName("sbutton large")[0].DomObject);

            if (button != null)
            {
                button.Click();
            }

            MessageBox.Show("Loaded");
            return(1);
        }
        public void AddVoiceActions(GeckoDocument document, string tagName)
        {
            foreach (GeckoElement element in document.GetElementsByTagName(tagName))
            {
                VoiceAction action = new VoiceAction();
                action.label = element.TextContent.Trim();

                if (tagName == "button")
                {
                    action.task += () =>
                    {
                        GeckoButtonElement button = new GeckoButtonElement(element.DomObject);
                        button.Click();
                    };
                }

                if (tagName == "a")
                {
                    action.task += () =>
                    {
                        GeckoAnchorElement anchor = new GeckoAnchorElement(element.DomObject);
                        anchor.Click();
                    };
                }

                if (tagName == "iframe")
                {
                    action.task += () =>
                    {
                        GeckoButtonElement iframe = new GeckoButtonElement(element.DomObject);
                        iframe.Click();
                    };
                }
                actions.Add(action);
            }
        }