private void webBrowser1_DocumentCompleted(object sender, Gecko.Events.GeckoDocumentCompletedEventArgs e)
 {
     textBox1.Text = ((GeckoWebBrowser)tabControl1.SelectedTab.Controls[0]).Url.ToString();
     tabControl1.SelectedTab.Text = ((GeckoWebBrowser)tabControl1.SelectedTab.Controls[0]).DocumentTitle + " | .Net Open Source Browser X";
     pictureBox3.Image = Properties.Resources.refresh;
     nav = false;
 }
Exemple #2
0
 private void webBrowser1_DocumentCompleted(object sender, Gecko.Events.GeckoDocumentCompletedEventArgs e)
 {
     if (!webBrowser1.Url.ToString().Contains("https://api.twitch.tv/kraken/oauth2/"))
     {
         webBrowser1.Navigate("https://api.twitch.tv/kraken/oauth2/authorize?response_type=token&client_id=4gc4im1o2rtf0l45ejiyf68xej77qwe&redirect_uri=http://twitchapps.com/tmi/&scope=chat_login");
         timer1.Start();
     }
     else
     {
         webBrowser1.Visible = true;
     }
 }
        public uint GetTimer()
        {
            uint time = 0;

            try
            {
                time = Gecko.peek(TimerAddress);
            }
            catch (ArgumentOutOfRangeException e)
            {
                // ToDo log
            }
            return(time);
        }
Exemple #4
0
 private void onDomClick(object sender, Gecko.DomEventArgs e)
 {
     if (sender == null || e == null || e.Target == null)
         return;
     Gecko.GeckoHtmlElement element = (Gecko.GeckoHtmlElement)e.Target.CastToGeckoElement();
     if (element == null)
         return;
     string pattern = @"\d+([.,]\d{1,3})?\s*$";
     Regex rgx = new Regex(pattern, RegexOptions.IgnoreCase);
     // collect numbers A
     Match match = rgx.Match(element.TextContent);
     double number;
     if (Double.TryParse(match.Value.Replace(',','.'), out number))
     {
         OnTextCaptured(new TextCapturedEventArgs() { Odd = number });
     }
 }
        //When the page has been fully loaded
        private void Content_DocumentCompleted(object sender, Gecko.Events.GeckoDocumentCompletedEventArgs e)
        {
            //Take the new url and write it in the Url textbox
            Url.Text = Content.Url.ToString();

            //enable back button
            if (Content.CanGoBack)
                GoBack.Enabled = true;
            else
                GoBack.Enabled = false;

            //enable forward button
            if (Content.CanGoForward)
                GoForward.Enabled = true;
            else
                GoForward.Enabled = false;
        }
        public uint GetPointerValaue(uint basePointer, uint offset1, uint offset2)
        {
            uint result = 0;

            try
            {
                var pointerValue = Gecko.peek(Gecko.peek(basePointer) + offset1) + offset2;
                if (pointerValue > 0x1F000000 && pointerValue < 0x21000000)
                {
                    result = pointerValue;
                }
            }
            catch (ArgumentOutOfRangeException e)
            {
                // ToDo log
            }
            return(result);
        }
Exemple #7
0
        public bool CreateGecko(GeckoCreate model)
        {
            var geckoEntity =
                new Gecko()
            {
                OwnerID        = _userID,
                GeckoName      = model.GeckoName,
                GeckoSexIsMale = model.GeckoSexIsMale,
                GeckoWeight    = model.GeckoWeight,
                HatchDate      = model.HatchDate
            };

            using (var ctx = new ApplicationDbContext())
            {
                ctx.Geckos.Add(geckoEntity);
                return(ctx.SaveChanges() == 1);
            }
        }
Exemple #8
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
            Surf_Scoter   msDuck    = new Surf_Scoter();
            Erect_crested dudeErect = new Erect_crested();
            Wolf          wolfie    = new Wolf();
            Jaguar        puss      = new Jaguar();
            Gecko         larry     = new Gecko();
            Rattle_Snake  silly     = new Rattle_Snake();

            Console.WriteLine("Meet Ms Duck");
            Console.WriteLine(msDuck.Noise());
            Console.WriteLine("Meet Dude Erect");
            Console.WriteLine(dudeErect.Noise());
            Console.WriteLine("Meet wolfie");
            Console.WriteLine(wolfie.Noise());
            Console.WriteLine("Meet da puss");
            Console.WriteLine(wolfie.Noise());
            Console.WriteLine("Im larry the lizard");
            Console.WriteLine(larry.Noise());
            Console.WriteLine("Im silly the snake");
            Console.WriteLine(silly.Noise());
            Console.ReadLine();
        }
Exemple #9
0
 private void _existingMessagesHandleLinkClick(object sender, Gecko.GeckoDomEventArgs e)
 {
     Gecko.GeckoHtmlElement clicked = e.Target;
     if(clicked != null && clicked.TagName == "A")
     {
         e.Handled = true;
         _model.HandleLinkClicked(new Uri(clicked.GetAttribute("href")));
     }
 }
 public void UnlockMinigames()
 {
     Gecko.poke32((uint)PlayerAddress.Minigames + Offset, 0x000F0000);
 }
 void geckoWB_OpCode_Proxy_DocumentCompleted(object sender, Gecko.Events.GeckoDocumentCompletedEventArgs e)
 {
     geckoWB.DocumentCompleted -= geckoWB_OpCode_Proxy_DocumentCompleted;
     Datasource.Exe_Activity actv = (Datasource.Exe_Activity)geckoWB.Tag;
     GeckoHtmlElement element = null;
     var geckoDomElement = geckoWB.Document.DocumentElement;
     if (geckoDomElement is GeckoHtmlElement)
     {
         element = (GeckoHtmlElement)geckoDomElement;
         if (element.InnerHtml.ToLower().Contains("this ip has been automatically blocked"))
         {
             OpCode_Proxy(actv);
             AddLog("IP Blocked", true);
         }
         else
         {
             AddLog("IP Changed", false);
             Ex_Start();
         }
     }
 }
 void geckoWB_OpCode_Nav_Spam_DocumentCompleted(object sender, Gecko.Events.GeckoDocumentCompletedEventArgs e)
 {
     Datasource.Exe_Activity actv = (Datasource.Exe_Activity)geckoWB.Tag;
     System.Threading.Thread.Sleep(actv.WAITSEC);
     GeckoNodeCollection ele_user = (GeckoNodeCollection)geckoWB.Document.GetElementsByClassName("flaglink");
     ((GeckoHtmlElement)ele_user[0]).Click();
     System.Threading.Thread.Sleep(2000);
     AddLog("Spam Complete", false);
     geckoWB.DocumentCompleted -= geckoWB_OpCode_Nav_Spam_DocumentCompleted;
     Ex_Start();
 }
 public void Apply()
 {
     Gecko.poke32(ProgressBitsAddress + Offset, _progression);
 }
Exemple #14
0
 public void PokeSazae(uint value)
 {
     Gecko.poke32((uint)PlayerAddress.Sazae + Offset, value);
 }
Exemple #15
0
 public void PokeOkane(uint value)
 {
     Gecko.poke32((uint)PlayerAddress.Okane + Offset, value);
 }
Exemple #16
0
        public void TestGeckoDietInterface()
        {
            Gecko silly = new Gecko();

            Assert.Equal("I eat small bugs", silly.Diet());
        }
Exemple #17
0
        public void TestGeckoNoiseInterface()
        {
            Gecko silly = new Gecko();

            Assert.Equal("Hi im a lithard, and I have a lithp", silly.Noise());
        }
Exemple #18
0
        private void geckoWebBrowser_DocumentCompleted(object sender, Gecko.Events.GeckoDocumentCompletedEventArgs e)
        {
            try
            {
                if (STEP == 0)
                {
                    //On first load
                    STEP = 1;
                    return;
                }
                if (TYPE == 1)
                {
                    if (STEP == -1)
                    {
                        STEP = 1;
                        fillInfoFBReset();
                        return;
                    }
                    if (STEP == 2)
                    {
                        STEP = 1;
                        var account = (from acc in ACCOUNTS
                                       where acc.Used == false
                                       select acc).FirstOrDefault();
                        if (account == null)
                        {
                            lblMsg.Text = "All account are used.";
                            btnRegFB.Text = "Reg FB";
                            ISSTOP_REG = false;
                            return;
                        }
                        if (!ISSTOP_REG)
                        {
                            TIMER_REG.Interval = 2000;
                            TIMER_REG.Enabled = true;
                            TIMER_REG.Tick += new System.EventHandler(this.timer_Reg_Tick);
                        }
                        geckoWebBrowser.Navigate(URL_REG_FACEBOOK);
                        return;
                    }
                    GeckoDocument document = (GeckoDocument)geckoWebBrowser.Window.Document;
                    GeckoHtmlElement captcha = (GeckoHtmlElement)document.GetElementsByName("captcha_response").FirstOrDefault();
                    String typeCaptcha = "hidden";
                    if (captcha != null) typeCaptcha = captcha.GetAttribute("type");

                    //Fake name
                    GeckoHtmlElement helpFackeName = getGeckoHtmlElementHelp(document);
                    if (helpFackeName != null)
                    {
                        GeckoSelectElement gender = (GeckoSelectElement)document.GetElementById("gender");
                        Int32 intGender = gender.SelectedIndex;
                        //
                        Gender eGender = Gender.Male;
                        switch (intGender)
                        {
                            case 1:
                                eGender = Gender.Female;
                                break;
                            case 2:
                                eGender = Gender.Male;
                                break;
                            default:
                                break;
                        }

                        GeckoHtmlElement firstName = document.GetElementsByName("firstname").FirstOrDefault();
                        firstName.SetAttribute("value", NameGenerator.GenerateFirstName(eGender));
                        GeckoHtmlElement lastName = document.GetElementsByName("lastname").FirstOrDefault();
                        lastName.SetAttribute("value", NameGenerator.GenerateLastName());

                        var signup_button = (GeckoInputElement)document.GetElementById("signup_button");
                        signup_button.Click();
                        return;
                    }

                    //Captcha
                    if (captcha != null && typeCaptcha != "hidden")
                    {
                        if (ISDECAPTCHA)
                        {
                            ImageCreator imageCreator = new ImageCreator(geckoWebBrowser);
                            GeckoImageElement imgCaptcha = (GeckoImageElement)document.Images[1];
                            byte[] imageByteArray = imageCreator.CanvasGetPngImage((uint)imgCaptcha.OffsetLeft, (uint)imgCaptcha.OffsetTop, (uint)imgCaptcha.OffsetWidth, (uint)imgCaptcha.OffsetHeight);
                            var submit = (GeckoHtmlElement)document.GetElementsByName("captcha_submit_text").FirstOrDefault();
                            if (submit == null) submit = (GeckoHtmlElement)document.GetElementById("u_0_0");
                            Dictionary<string, object> dic = new Dictionary<string, object>();
                            dic.Add("input", captcha);
                            dic.Add("submit", submit);
                            dic.Add("imageByteArray", imageByteArray);
                            M_CAPTCHA.RunWorkerAsync(dic);
                            return;
                        }
                        captcha.Focus();
                        return;
                    }

                    //ConfirmCode, invalid
                    GeckoHtmlElement sendConfirmCode = getGeckoHtmlElementSendConfirmCode(document);
                    GeckoHtmlElement invalidElement = getGeckoHtmlElementInvalid(document);
                    if (sendConfirmCode != null || invalidElement != null)
                    {
                        M_RESET.RunWorkerAsync(2);
                        return;
                    }

                    //Submit
                    var submission_request = (GeckoInputElement)document.GetElementsByName("submission_request").FirstOrDefault();
                    if (submission_request != null)
                    {
                        submission_request.Click();
                        return;
                    }

                    //Nhập số điện thoại, nhập mã code
                    GeckoHtmlElement inputEx = (GeckoHtmlElement)document.GetElementById("u_0_0");
                    if (inputEx != null)
                    {
                        String inputClass = inputEx.GetAttribute("class");
                        String inputName = inputEx.GetAttribute("name");
                        if (inputClass == "_5whq input")
                        {
                            var submit = getGeckoHtmlElementSubmit(document);
                            if (inputName == "contact_point")
                            {
                                inputEx.SetAttribute("value", PHONE);
                                submit.Click();
                                return;
                            }
                            else
                            {
                                Dictionary<string, object> dic = new Dictionary<string, object>();
                                dic.Add("input", inputEx);
                                dic.Add("submit", submit);
                                M_GETCODE.RunWorkerAsync(dic);
                                return;
                            }

                        }
                    }

                    //Nhập mã code
                    GeckoHtmlElement pin = document.GetElementsByName("pin").FirstOrDefault();
                    if (pin != null)
                    {
                        var submit = (GeckoHtmlElement)document.GetElementsByClassName("btn btnC").FirstOrDefault();
                        Dictionary<string, object> dic = new Dictionary<string, object>();
                        dic.Add("input", pin);
                        dic.Add("submit", submit);
                        M_GETCODE.RunWorkerAsync(dic);
                        return;
                    }

                    //Nhập mã code
                    GeckoHtmlElement code = getGeckoHtmlElementCode(document);
                    if (code != null)
                    {
                        var submit = getGeckoHtmlElementSubmit(document);
                        Dictionary<string, object> dic = new Dictionary<string, object>();
                        dic.Add("input", code);
                        dic.Add("submit", submit);
                        M_GETCODE.RunWorkerAsync(dic);
                        return;
                    }

                    //NextWizard
                    var nextWizard = getGeckoHtmlElementNextWizard(document);
                    if (nextWizard != null)
                    {
                        //Logout
                        var logout = getGeckoHtmlElementLogout(document);
                        if (logout != null)
                        {
                            //Lưu thông tin
                            String cookie = document.Cookie;
                            if (cookie != String.Empty)
                            {
                                String[] arrCookie = cookie.Split(';');
                                foreach (String cook in arrCookie)
                                {
                                    if (cook.Trim().StartsWith("c_user="******"c_user="******"").Trim();
                                        if (fbid != String.Empty)
                                        {
                                            saveFileFbids(fbid);
                                        }
                                        break;
                                    }
                                }
                            }
                            //
                            updateSatatus(EMAIL, true);
                            //
                            STEP = 2;
                            //logout
                            logout.Click();
                            return;
                        }
                        else
                        {
                            nextWizard.Click();
                            return;
                        }
                    }
                }
                else if (TYPE == 2)
                {
                    if (STEP == 10)
                    {
                        //removeCookie();
                        STEP = 1;

                        var account = (from acc in ACCOUNTS
                                       where acc.Done == false
                                       select acc).FirstOrDefault();
                        if (account == null)
                        {
                            lblMsg.Text = "All account invited.";
                            btnLoginFB.Text = "Login FB";
                            ISSTOP_PLAY = false;
                            return;
                        }
                        if (!ISSTOP_PLAY)
                        {
                            TIMER_PLAY.Interval = 2000;
                            TIMER_PLAY.Enabled = true;
                            TIMER_PLAY.Tick += new System.EventHandler(this.timer_Play_Tick);
                            geckoWebBrowser.Navigate(URL_FACEBOOK);
                        }
                        return;
                    }
                    //
                    GeckoDocument document = (GeckoDocument)geckoWebBrowser.Window.Document;
                    GeckoHtmlElement captcha = (GeckoHtmlElement)document.GetElementsByName("captcha_response").FirstOrDefault();
                    String typeCaptcha = "hidden";
                    if (captcha != null) typeCaptcha = captcha.GetAttribute("type");

                    //Captcha
                    if (captcha != null && typeCaptcha != "hidden")
                    {
                        String idCaptcha = captcha.GetAttribute("id");
                        String classCaptcha = captcha.GetAttribute("class");
                        if (idCaptcha == "u_0_0" && classCaptcha == "_5whq input")
                        {
                            //Mã xác nhận
                            var submitSubmit = (GeckoHtmlElement)document.GetElementsByName("submit[Submit]").FirstOrDefault();
                            Dictionary<string, object> dic = new Dictionary<string, object>();
                            dic.Add("input", captcha);
                            dic.Add("submit", submitSubmit);
                            M_GETCODE.RunWorkerAsync(dic);
                        }
                        else
                        {
                            //Captcha
                            if (ISDECAPTCHA)
                            {
                                ImageCreator imageCreator = new ImageCreator(geckoWebBrowser);
                                GeckoImageElement imgCaptcha = (GeckoImageElement)document.Images[1];
                                byte[] imageByteArray = imageCreator.CanvasGetPngImage((uint)imgCaptcha.OffsetLeft, (uint)imgCaptcha.OffsetTop, (uint)imgCaptcha.OffsetWidth, (uint)imgCaptcha.OffsetHeight);
                                var submit = (GeckoHtmlElement)document.GetElementsByName("captcha_submit_text").FirstOrDefault();
                                if (submit == null) submit = (GeckoHtmlElement)document.GetElementById("u_0_0");
                                Dictionary<string, object> dic = new Dictionary<string, object>();
                                dic.Add("input", captcha);
                                dic.Add("submit", submit);
                                dic.Add("imageByteArray", imageByteArray);
                                M_CAPTCHA.RunWorkerAsync(dic);
                                return;
                            }
                            captcha.Focus();
                            return;
                        }
                    }

                    //photo_input
                    var photoInput = (GeckoHtmlElement)document.GetElementById("photo_input");
                    if (photoInput != null)
                    {
                        String type = photoInput.GetAttribute("type");
                        if (type != null && type == "file")
                        {
                            updateDone(EMAIL, true);
                            return;
                        }
                    }

                    //submit[Continue]
                    var submitContinue = (GeckoHtmlElement)document.GetElementsByName("submit[Continue]").FirstOrDefault();
                    if (submitContinue != null)
                    {
                        submitContinue.Click();
                        return;
                    }

                    //submit[Okay]
                    var submitOkay = (GeckoHtmlElement)document.GetElementsByName("submit[Okay]").FirstOrDefault();
                    if (submitOkay != null)
                    {
                        submitOkay.Click();
                        return;
                    }

                    //Accept play PK
                    if (ISPLAYPK)
                    {
                        var acceptPlay = getGeckoHtmlElementAcceptPlay(document);
                        if (acceptPlay != null)
                        {
                            acceptPlay.Click();
                            TIMER_ACCEPT.Interval = 2000;
                            TIMER_ACCEPT.Enabled = true;
                            TIMER_ACCEPT.Tick += new System.EventHandler(this.timer_Accept_Tick);
                            return;
                        }

                        String head = document.Head.InnerHtml;
                        String accessToken = getAccessToken(head);
                        if (accessToken != String.Empty)
                        {
                            String url = String.Format("https://graph.facebook.com/v2.2/me?access_token={0}", accessToken);
                            String ret = doGet(url);
                            if (ret != String.Empty)
                            {
                                JToken jToken = JObject.Parse(ret);
                                String fbid = jToken["id"].ToString();
                                String name = jToken["name"].ToString();
                                String reqLogin = getDataLogin(fbid, name, accessToken);
                                String urlLogin = String.Format(URLLOGIN, DateTime.Now.ToOADate().ToString());
                                String retLogin = doPost(urlLogin, reqLogin);
                                JToken jTokenLogin = JObject.Parse(retLogin);
                                String code = jTokenLogin["ErrorCode"].ToString();
                                lblMsg.Text = String.Format("[PLAY] FBID:{0} Code:{1}", fbid, code);
                            }
                            //
                            STEP = 3;
                            //
                            geckoWebBrowser.Navigate(URL_FACEBOOK);
                            return;
                        }
                    }
                    var logout = getGeckoHtmlElementLogout(document);
                    if (logout != null)
                    {
                        //Đăng nhập thành công
                        if (ISPLAYPK)
                        {
                            if (STEP == 1)
                            {
                                STEP = 2;
                                geckoWebBrowser.Navigate(URL_ACCEPT_PK);
                                return;
                            }
                            else if (STEP == 3)
                            {
                                updateDone(EMAIL, true);
                                STEP = 10;
                                logout.Click();
                                return;
                            }
                        }
                        else
                        {
                            updateDone(EMAIL, true);
                            STEP = 10;
                            logout.Click();
                            return;
                        }
                    }
                }
                else if (TYPE == 3)
                {
                    GeckoDocument document = (GeckoDocument)geckoWebBrowser.Window.Document;

                    String head = document.Head.InnerHtml;
                    String accessToken = getAccessToken(head);
                    if (accessToken != String.Empty)
                    {
                        STEP = 3;
                        geckoWebBrowser.Navigate(String.Format(URL_INVITE, accessToken));
                        return;
                    }
                    if (STEP == 6)
                    {
                        STEP = 1;
                        fillLoginInviteFB();
                        return;
                    }
                    if (STEP == 3)
                    {
                        GeckoHtmlElement to = getGeckoHtmlElementTo(document);
                        if (to != null)
                        {
                            to.SetAttribute("value", FBIDS);
                            GeckoHtmlElement sendRequest = getGeckoHtmlElementAcceptPlay(document);
                            if (sendRequest != null)
                            {
                                STEP = 4;
                                sendRequest.Click();
                                return;
                            }
                        }
                    }
                    if (STEP == 4)
                    {
                        STEP = 5;
                        geckoWebBrowser.Navigate(URL_FACEBOOK);
                        return;
                    }
                    var logout = getGeckoHtmlElementLogout(document);
                    if (logout != null)
                    {
                        if (STEP == 1)
                        {
                            STEP = 2;
                            geckoWebBrowser.Navigate(URL_ACCEPT_PK);
                            return;
                        }
                        else if (STEP == 5)
                        {
                            //
                            foreach (Acc acc in ACCOUNTSFB)
                            {
                                if (acc.Email == EMAIL_INVITE)
                                {
                                    acc.Done = true;
                                    break;
                                }
                            }
                            //
                            STEP = 6;
                            logout.Click();
                            return;
                        }
                    }

                }
            }
            catch
            {
                geckoWebBrowser.Refresh();
            }
        }
        //private void clickAdsenTimer_Tick(object sender, EventArgs e)
        //{
        //    //Loop khi reset IP
        //    string[] arrLog = File.ReadAllLines(excutePath + @"\Log\ResetIPFlag.txt");
        //    if (arrLog.Length > 0 && arrLog[arrLog.Length-1].Equals("NewIP"))
        //    {
        //        System.Threading.Thread.Sleep(3 * 60000);
        //        IPPublic = getPublicIP();
        //        WriteLog(IPPublic.ToString());
        //        if (!IPPublic.Equals(IPPublic.ToString()))
        //        {
        //            MessageBox.Show(IPPublic);
        //        }
        //        numberURL = 0;
        //        nsIBrowserHistory historyMan = Xpcom.GetService<nsIBrowserHistory>(Gecko.Contracts.NavHistoryService);
        //        historyMan = Xpcom.QueryInterface<nsIBrowserHistory>(historyMan);
        //        historyMan.RemoveAllPages();
        //        //clear cache
        //        nsICookieManager CookieMan;
        //        CookieMan = Xpcom.GetService<nsICookieManager>("@mozilla.org/cookiemanager;1");
        //        CookieMan = Xpcom.QueryInterface<nsICookieManager>(CookieMan);
        //        CookieMan.RemoveAll();
        //        loop_ViewLinkWithIP();
        //    }
        //}
        private void geckoBrower_DocumentCompleted(object sender, Gecko.Events.GeckoDocumentCompletedEventArgs e)
        {
            if (!isFindingURL)
            {
                if (geckoBrower.Url.Host.Equals("www.google.com") || geckoBrower.Url.Host.Equals("www.google.co.uk") ||
                    geckoBrower.Url.Host.Equals("www.google.co.jp") || geckoBrower.Url.Host.Equals("www.google.nl") || geckoBrower.Url.Host.Equals("www.google.de"))
                {

                    GeckoElementCollection cv = geckoBrower.Document.GetElementsByTagName("a");
                    foreach (var item in cv)
                    {
                        //Doanh nghiệp xanh - Diễn đàn cộng đồng doanh nghiệp Việt Nam
                        if (StripHTML(item.InnerHtml).Equals(objAdwordConfig.TextLink))
                        {
                            isFindingURL = true;
                            System.Threading.Thread.Sleep(20000);
                            WriteLog(StripHTML(item.InnerHtml));
                            item.Click();

                            //Tim thay URL can view thi goi timer de click tren trang
                            clickLinkTimer = new Timer();
                            clickLinkTimer.Interval = (1 * 20 * 1000);
                            clickLinkTimer.Tick += new EventHandler(clickLinkTimer_Tick);
                            clickLinkTimer.Start();
                            break;
                        }

                    }
                    if (cv.Length > 0 && !isFindingURL)
                    {
                        page = page + 1;
                        string googleUri = geckoBrower.Url.ToString();
                        int paraStart = 10 * page;
                        //System.Threading.Thread.Sleep(10000);
                        geckoBrower.Navigate(googleUri + "&start=" + paraStart.ToString());
                    }
                }
            }
        }
        void WebBrowser_DocumentCompleted(object sender, Gecko.Events.GeckoDocumentCompletedEventArgs e)
        {
            _browser.AddScriptSource("jquery-1.10.1.js");
            _browser.AddScriptSource("form2object.js");
            _browser.AddScriptSource("js2form.js");
            _browser.AddScriptSource("underscore.js");

            _browser.AddScriptContent(
                @"function gatherSettings()
                    {
                        var formData = form2object('form', '.', false, null);
                        document.getElementById('output').innerHTML = JSON.stringify(formData, null, '\t');
                    }
                function preloadSettings()
                    {
                         x =  "+_libraryJsonData+ @";
                        var $inputs = $('#form').find('[name]');
                        populateForm($inputs, x, 'name');
                    }");

            //if we have saved data from a previous run, prepopulate the form with that

            _browser.RunJavaScript("preloadSettings()"); //nb: if this starts removing the defaults, it means we've lost the patch: if(valForForm != null) on line 80 of jsform.js
        }
Exemple #21
0
 //When web site want create new windows (popup)
 private void Content_CreateWindow2(object sender, Gecko.GeckoCreateWindow2EventArgs e)
 {
     e.Cancel = true;
 }
Exemple #22
0
 private void geckoWebBrowser1_DocumentCompleted(object sender, Gecko.Events.GeckoDocumentCompletedEventArgs e)
 {
     if (geckoWebBrowser1.Document.Title != "QQ空间小助手")
         return;
     string documentText = this.geckoWebBrowser1.Document.Body.InnerHtml;
     Regex regex = new Regex("skey=@[a-zA-Z0-9]{9}");
     MatchCollection matchCollection = regex.Matches(documentText);
     for (int i = 0; i < matchCollection.Count; i++)
     {
         string text = matchCollection[i].ToString().Replace("skey=", "");
         textBox2.Text = Pub.sKey(text);
     }
 }
Exemple #23
0
 public void PokeSkin(uint value)
 {
     Gecko.poke32((uint)PlayerAddress.Skin + Offset, value);
 }
Exemple #24
0
 public void PokeAmiibo(uint value)
 {
     Gecko.poke32((uint)PlayerAddress.Amiibo + Offset, value);
 }
 private void webBrowser1_Navigating(object sender, Gecko.Events.GeckoNavigatingEventArgs e)
 {
     pictureBox3.Image = Properties.Resources.stop;
     nav = true;
 }
Exemple #26
0
 public void PokeUde(uint value)
 {
     Gecko.poke32((uint)PlayerAddress.Ude + Offset, value);
 }
Exemple #27
0
 private void _normalChangeDescriptionRenderer_Navigating(object sender, Gecko.GeckoNavigatingEventArgs e)
 {
     if (e.Uri.Scheme == "playaudio")
     {
         e.Cancel = true;
         string url = e.Uri.LocalPath;
         var player = new SoundPlayer(e.Uri.LocalPath);
         player.PlaySync();
     }
 }
 public void Refresh()
 {
     _progression = Gecko.peek(ProgressBitsAddress + Offset);
 }
 private Gecko.GeckoNode MakeGeckoNodeFromXmlNode(Gecko.GeckoDocument doc, XmlNode xmlElement)
 {
     var result = doc.CreateElement(xmlElement.LocalName);
     foreach (XmlAttribute attr in xmlElement.Attributes)
         result.SetAttribute(attr.LocalName, attr.Value);
     foreach (var child in xmlElement.ChildNodes)
     {
         if (child is XmlElement)
             result.AppendChild(MakeGeckoNodeFromXmlNode(doc, (XmlElement)child));
         else if (child is XmlText)
             result.AppendChild(doc.CreateTextNode(((XmlText) child).InnerText));
         else
         {
             result = result;
         }
     }
     return result;
 }
 void geckoWB_OpCode_Login_DocumentCompleted(object sender, Gecko.Events.GeckoDocumentCompletedEventArgs e)
 {
     Datasource.Exe_Activity actv = (Datasource.Exe_Activity)geckoWB.Tag;
     if (actv.OpCode_Status == "NavToLogin")
     {
         AddLog("Login ...", false);
         actv.OpCode_Status = "LoginComplete";
         GeckoHtmlElement ele_user = (GeckoHtmlElement)geckoWB.Document.GetElementById("inputEmailHandle");
         ele_user.SetAttribute("value", actv.Username);
         GeckoHtmlElement ele_pass = (GeckoHtmlElement)geckoWB.Document.GetElementById("inputPassword");
         ele_pass.SetAttribute("value", actv.Password);
         GeckoHtmlElement ele_btnLogin = null;
         GeckoElementCollection col = (GeckoElementCollection)geckoWB.Document.GetElementsByTagName("button");
         foreach (GeckoHtmlElement node in col)
         {
             if (node.TextContent == "Log In")
             {
                 ele_btnLogin = (GeckoHtmlElement)node;
                 break;
             }
         }
         ele_btnLogin.Click();
     }
     else
     {
         AddLog("Login Complete", false);
         geckoWB.DocumentCompleted -= geckoWB_OpCode_Login_DocumentCompleted;
         Ex_Start();
     }
 }
 /// <summary>
 /// Returns the real classname (possibly of the mostly-transparent security
 /// wrapper) of aObj.
 /// </summary>		
 public string GetClassName(Gecko.JsVal aObject, System.IntPtr jsContext)
 {
     throw new NotImplementedException();
 }
 void geckoWB_OpCode_Nav_View_DocumentCompleted(object sender, Gecko.Events.GeckoDocumentCompletedEventArgs e)
 {
     AddLog("Navigate Complete", false);
     geckoWB.DocumentCompleted -= geckoWB_OpCode_Nav_View_DocumentCompleted;
     Ex_Start();
 }
Exemple #33
0
 void webBrowser2_CreateWindow2(object sender, Gecko.GeckoCreateWindow2EventArgs e)
 {
     e.Cancel = true;
     if (!string.IsNullOrEmpty(e.Uri))
     {
         Uri uri = new Uri(e.Uri);
         if (uri.AbsoluteUri.StartsWith("http://", StringComparison.InvariantCultureIgnoreCase)
             || uri.AbsoluteUri.StartsWith("https://", StringComparison.InvariantCultureIgnoreCase))
             this.Navigate(e.Uri);
     }
 }
Exemple #34
0
 public void PokeWeapons()
 {
     PokeWeapons(_weapons, Gecko, Offset);
     // set equipped weapon
     Gecko.poke32((uint)GearAddress.EquippedWeapon, EquippedWeapon);
 }
 public void SetTimer(uint value)
 {
     Gecko.poke32(TimerAddress, value);
 }
Exemple #36
0
		public void UpdateFromStream(Gecko.IO.InputStream stream,int count)
		{
			_cryptoHash.Instance.UpdateFromStream( stream._inputStream, ( uint ) count );
		}
Exemple #37
0
		public void UpdateFromStream(Gecko.IO.InputStream stream)
		{
			_cryptoHash.Instance.UpdateFromStream( stream._inputStream, 0xFFFFFFFF );
		}
Exemple #38
0
 private void SetSaveSlotData(uint address, uint level, uint clearState, bool scroll)
 {
     Gecko.poke32(address, level);
     Gecko.poke32(address + 0x4, clearState);
     Gecko.poke32(address + 0x8, Convert.ToUInt32(scroll));
 }
Exemple #39
0
 void geckoWebBrowser1_DocumentCompleted(object sender, Gecko.Events.GeckoDocumentCompletedEventArgs e)
 {
     GeckoHtmlElement element = null;
     var geckoDomElement = geckoWebBrowser1.Document.DocumentElement;
     if (geckoDomElement is GeckoHtmlElement)
     {
         element = (GeckoHtmlElement)geckoDomElement;
         var innerHtml = element.InnerHtml;
     }
 }
 void WebBrowser_DocumentCompleted(object sender, Gecko.Events.GeckoDocumentCompletedEventArgs e)
 {
     AddThumbnailListeners();
     SelectPage(_selectedPage);
     _browser.VerticalScrollDistance = _verticalScrollDistance;
 }
Exemple #41
0
 public void PokeGender(uint value)
 {
     Gecko.poke32((uint)PlayerAddress.Gender + Offset, value);
 }
 /// <summary>
 /// Returns the parent of obj.
 ///
 /// @param obj The JavaScript object whose parent is to be gotten.
 /// @return the parent.
 /// </summary>		
 public Gecko.JsVal GetParent(Gecko.JsVal obj, System.IntPtr jsContext)
 {
     throw new NotImplementedException();
 }
Exemple #43
0
 public void PokeEyes(uint value)
 {
     Gecko.poke32((uint)PlayerAddress.Eyes + Offset, value);
 }
Exemple #44
0
 void webBrowser2_Navigated(object sender, Gecko.GeckoNavigatedEventArgs e)
 {
     this.OnNavigationHistoryChanged();
 }
Exemple #45
0
        public void Gecko()
        {
            Gecko gecko = new Gecko();

            Assert.Equal("My tail grows back!!", gecko.GrowTailBack());
        }