Click here to Skip to main content
15,887,596 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello i want to make a control like this. I'am taking twitter ID and Password from user. via textBox and when i pressed "check" button webBrowser puts them to the twitter's form controls. SO i login. But when i write wrong ID or Password , i want to sent a message to user like "Wrong ID or Password" thanks for your helps.

When i press button timer control starts. Here is my timer1_Tick event.

C#
private void timer1_Tick(object sender, EventArgs e)
        {
            webBrowser1.Document.GetElementById("signin-email").SetAttribute("value", "exampleID");
            webBrowser1.Document.GetElementById("signin-password").SetAttribute("value","examplePASSWORD");
            foreach (HtmlElement el in webBrowser1.Document.GetElementsByTagName("button"))
            {

                if (el.GetAttribute("className") == "submit btn primary-btn flex-table-btn js-submit") // i found button control with this
                {
                     el.InvokeMember("click"); // click to button
                    /*if (success) // control .. here is my problem
                      { 
                      timer1.Stop();
                      mbox("success login");
                      }
                    else
                    {
                    timer1.Stop();
                    mbox("login failed");
                    }
                    */
                    break;
                }
                
            }
        }
Posted
Comments
ZurdoDev 7-Dec-14 22:11pm    
1. Why are you using a timer to login a user?

2. Don't you get a different response back when you pass in invalid credentials?
vijay chander 13-Dec-14 1:23am    
Why you're using Timer??

1 solution

you can check the url, it will change to something like this: https://twitter.com/login/error?username_or_email=asd&redirect_after_login=%2F[^]

if you started at https://twitter.com/[^] this can help you figure out.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900