Пример #1
0
        private void WebBrowser_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
        {
            memoLogs.Text = webBrowser.DocumentText;
            if (webBrowser.Url.LocalPath.Contains("giris"))
            {
                webBrowser.Document.GetElementById("username").InnerText = "*****@*****.**";
                webBrowser.Document.GetElementById("password").InnerText = "prjsahibinden46";

                foreach (HtmlElement HtmlElement1 in webBrowser.Document.Body.All)
                {
                    if (HtmlElement1.GetAttribute("id") == "userLoginSubmitButton")
                    {
                        HtmlElement1.InvokeMember("click");
                        break;
                    }
                }
            }
            else if (webBrowser.Url.AbsoluteUri == "https://banaozel.sahibinden.com/")
            {
                webBrowser.Navigate(@"https://www.sahibinden.com/ilan/865519334/detay/");
            }
            else if (webBrowser.Url.LocalPath.Contains("detay"))
            {
                webBrowser.DocumentCompleted -= WebBrowser_DocumentCompleted;
                timer.Start();
            }
        }
Пример #2
0
        private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
        {
            if (dashboardBrowser.Url != null)
            {
                webAddressBox.Text = dashboardBrowser.Url.ToString();
            }

            if (dashboardBrowser.Url.ToString().Contains(@"login.live.com/login"))
            {
                foreach (HtmlElement HtmlElement1 in dashboardBrowser.Document.Body.All) //Force post (login).
                {
                    if (HtmlElement1.GetAttribute("name") == "loginfmt")
                    {
                        HtmlElement1.SetAttribute("value", username);
                    }
                    if (HtmlElement1.GetAttribute("name") == "passwd")
                    {
                        HtmlElement1.SetAttribute("value", password);
                    }
                    if (HtmlElement1.GetAttribute("value") == "Sign in")
                    {
                        HtmlElement1.InvokeMember("click");
                    }
                }
            }

            //if (dashboardBrowser.Url.ToString().Equals(@"http://www.msn.com/") || dashboardBrowser.Url.ToString().Contains(@"bing.com/rewards/dashboard")) //done logging in
            //    dashboardBrowser.Navigate(new Uri("http://www.bing.com/rewards/redeem/shop"));
        }
Пример #3
0
 private void login(string username, string pass)
 {
     if (webBrowser1.Url.AbsoluteUri == uri)
     {
         foreach (HtmlElement HtmlElement1 in webBrowser1.Document.Body.All)
         {
             if (HtmlElement1.GetAttribute("id").Contains("_xfUid-1"))
             {
                 HtmlElement1.InnerText = username;
             }
             else if (HtmlElement1.GetAttribute("id").Contains("_xfUid-2"))
             {
                 HtmlElement1.InnerText = pass;
             }
             else if (HtmlElement1.OuterText == "Giriş yap")
             {
                 HtmlElement1.InvokeMember("click");
             }
         }
     }
 }
Пример #4
0
        private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
        {
            stuckTimer.Enabled = false;
            if (webBrowser1.Url.ToString() == "about:blank" || webBrowser1.Url.ToString() == "" || webBrowser1.Url == null || webBrowser1.Url.ToString().Contains(@"newagesoldier.com"))
            {
                return;
            }

            if (webBrowser1.Url.ToString().Contains(@"msn.com"))
            {
                webBrowser1.Navigate(new Uri("https://login.live.com/login.srf?wa=wsignin1.0&rpsnv=12&ct=1406628123&rver=6.0.5286.0&wp=MBI&wreply=https:%2F%2Fwww.bing.com%2Fsecure%2FPassport.aspx%3Frequrl%3Dhttp%253a%252f%252fwww.bing.com%252frewards%252fdashboard"));
            }

            if (mobile)
            {
                searchModeBox.Text = "mobile";
            }
            else
            {
                searchModeBox.Text = "desktop";
            }

            searchesLeftBox.Text = countDown.ToString();
            accountBox.Text      = username;

            notesBox.Text = webBrowser1.Url.ToString();
            if (webBrowser1.Url.ToString().Contains(@"login.live.com/login"))
            {
                foreach (HtmlElement HtmlElement1 in webBrowser1.Document.Body.All) //Force post (login).
                {
                    if (HtmlElement1.GetAttribute("name") == "login")
                    {
                        HtmlElement1.SetAttribute("value", username);
                    }
                    if (HtmlElement1.GetAttribute("name") == "passwd")
                    {
                        HtmlElement1.SetAttribute("value", password);
                    }
                    if (HtmlElement1.GetAttribute("value") == "Sign in")
                    {
                        HtmlElement1.InvokeMember("click");
                    }
                }
                return;
            }

            if (webBrowser1.Url.ToString().Contains(@"bing.com/rewards/dashboard"))
            {
                startTimer.Enabled = true;
            }

            if (webBrowser1.Url.ToString().Contains(@"bing.com/Passport") || webBrowser1.Url.ToString().Contains(@"login.live.com/gls") || webBrowser1.Url.ToString().Contains(@"login.live.com/logout") || webBrowser1.Url.ToString().Contains(@"bing.com/secure") || webBrowser1.Url.ToString().Contains(@"bing.com/rewards/dashboard") || webBrowser1.Url.ToString().Contains(@"msn.com"))
            {
                return; //let timer finish the login process before reading another account OR going to the next search.
            }
            if (!webBrowser1.Url.ToString().Contains(@"?q="))
            {
                return;
            }

            if (countDown >= 1)
            {
                searchTimer.Enabled = true;
            }
            else
            {
                ReadAccounts(accountNum);
            }
        }
Пример #5
0
        private async void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
        {
            stuckTimer.Enabled = false;
            if (webBrowser1.Url.ToString().Contains(@"login.live.com/login"))
            {
                await PutTaskDelay2();                                              //wait for HTML elements to load in

                foreach (HtmlElement HtmlElement1 in webBrowser1.Document.Body.All) //fake a sign in
                {
                    if (HtmlElement1.GetAttribute("value") == "Sign in")
                    {
                        HtmlElement1.InvokeMember("click");
                    }
                }
                aix3c.ControlClick("Bing Rewards Search Bot", "", "[CLASS:Internet Explorer_Server; INSTANCE:2]");
                webBrowser1.Document.Body.Focus();
                await PutTaskDelay2(); //after focusing, wait a little bit

                aix3c.ControlSend("Bing Rewards Search Bot", "", "[CLASS:Internet Explorer_Server; INSTANCE:2]", "{TAB}", 0);
                aix3c.ControlSend("Bing Rewards Search Bot", "", "[CLASS:Internet Explorer_Server; INSTANCE:2]", username, 0);
                aix3c.ControlSend("Bing Rewards Search Bot", "", "[CLASS:Internet Explorer_Server; INSTANCE:2]", "{TAB}", 0);
                aix3c.ControlSend("Bing Rewards Search Bot", "", "[CLASS:Internet Explorer_Server; INSTANCE:2]", password, 0);
                await PutTaskDelay2();

                foreach (HtmlElement HtmlElement1 in webBrowser1.Document.Body.All) //really sign in
                {
                    if (HtmlElement1.GetAttribute("value") == "Sign in")
                    {
                        HtmlElement1.InvokeMember("click");
                    }
                }
                return;
            }

            if (webBrowser1.Url.ToString() == "" || webBrowser1.Url == null || webBrowser1.Url.ToString().Contains(@"about:blank") || webBrowser1.Url.ToString().Contains(@"newagesoldier")) //could be refreshing page, or script behined the scenes
            {
                return;
            }

            if (webBrowser1.Url.ToString().Equals(@"http://www.msn.com/"))
            {
                dashboardWait.Enabled = true;
                webBrowser1.Navigate(new Uri("https://login.live.com/login.srf?wa=wsignin1.0&rpsnv=12&ct=1406628123&rver=6.0.5286.0&wp=MBI&wreply=https:%2F%2Fwww.bing.com%2Fsecure%2FPassport.aspx%3Frequrl%3Dhttp%253a%252f%252fwww.bing.com%252frewards%252fdashboard"));
                return;
            }

            if (webBrowser1.Url.ToString().Contains(@"bing.com/Passport") || webBrowser1.Url.ToString().Contains(@"live.com") || webBrowser1.Url.ToString().Contains(@"bing.com/secure"))
            {
                return; //after logout, we are redirected. Please wait.
            }
            if (mobile)
            {
                searchModeBox.Text = "mobile";
            }
            else
            {
                searchModeBox.Text = "desktop";
            }

            if (webBrowser1.Url.ToString().Contains(@"bing.com/rewards/dashboard"))
            {
                dashboardWait.Enabled = true;
                return;
            }

            searchesLeftBox.Text = countDown.ToString();
            accountBox.Text      = username;

            //if (!webBrowser1.Url.ToString().Contains(@"bing.com/rewards/dashboard"))
            //    return;

            if (countDown == 0)
            {
                if (mobile) //just finished with mobile, back to desktop
                {
                    startTimer.Enabled = true;
                }
                else
                { //switch to mobile
                    mobile              = true;
                    countDown           = Properties.Settings.Default.mobilesearches;
                    searchTimer.Enabled = true;
                }
            }
            else
            {
                searchTimer.Enabled = true;
            }

            if (!webBrowser1.Url.ToString().Contains(@"?q="))
            {
                return;
            }
        }