Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8811923
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T03:28:55+00:00 2026-06-14T03:28:55+00:00

I have created a c# windows application that have provided text box for user

  • 0

I have created a c# windows application that have provided text box for user id and password and upon clicking submit button it will automatically log-in an eBay account to http://www.ebay.com using webbrowser component. Logging in seems to be easy if the inputted username and password was correct. And now what i want to accomplish with your kind help is:

Every time the user inputs a wrong username or password on the windows application a message box will notify the user that the username and password was incorrect. And that the logging in to the website was unsuccessful.

Here is my code for WebBrowser’s event DocumentComplete.

 //webTest is the name of my web browser
    private void webTest_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
    {
        //boolean login variable checks if the button login was clicked.
        if (login == true)
        {
            //checks if the url is on the login page of eBay.
            if (webTest.Url.AbsoluteUri == loginPage)
            {
                    HtmlDocument doc = webTest.Document;
                    HtmlElement username = doc.GetElementById("userid");
                    HtmlElement password = doc.GetElementById("pass");
                    HtmlElement submit = doc.GetElementById("but_sgnBt");
                    username.SetAttribute("value", txtUser.Text);
                    password.SetAttribute("value", txtPassword.Text);
                    submit.InvokeMember("click");
                    login = false;
            }
            //else the webbrowser webtest will navigate to the login page,
            else
                webTest.Navigate(loginPage);
        }
    }

Thank you for all the reply i really appreciate it. May God Bless c#!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T03:28:56+00:00Added an answer on June 14, 2026 at 3:28 am

    Since webTest_DocumentCompleted will be called whenever a page is fully loaded, you should be able to detect if you were redirected from the login page to another page. For instance, the login page for eBay UK is located on the domain https://signin.ebay.co.uk/. A successful login transfers me to http://my.ebay.co.uk/ instead.

    You could check for this transfer in the webTest_DocumentCompleted method. If it did happen, you were logged in. If not, you were not logged in (and can show a message box to alert the user).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a textbox in a Windows Forms application that starts out at
I have a requirement to create a simple windows forms application that allows an
Today we have a windows application that, using an OCX, creates a web page
I have created Windows Application. In this, I have multiple tables in dataset, now
hello i have created one windows application in c# .net and its working fine
I have created a windows mobile application in Visual Studio. I want to templatize
I have created two forms in my Windows Application. One Form acts as a
We have created a simple wix project for a basic windows application. Everything builds
Im using c# .net windows application form. I have created many databases with many
I have created blank C#/XAML Windows 8 application. Add simple XAML code: <Page x:Class=Blank.MainPage

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.