First off, i would like to introduce myself. My name is Ryan, im 18 and a professional gamer.

About the client!
Well this client is for my clan members, they can login and retrieve updates, news, ect through a webbrowser

Help!

Okay, so i have set a webbrowser, two texboxes and a command button. The Form_Load is where i filled the navigate ( the online login form). So, it will basically type whatever you typed on the applications textboxes onto the online forms two textboxes and then it will hit click on the submit button on the online form to login.
Now heres the part where im having trouble, what i want to do is that when you type the information it will verify if that information is correct or incorrect and if it his correct it will show the form and if its not it will show an error message.

Dani AI

Generated

set up an embedded WebBrowser that fills the online login form from two app textboxes. Replies from and suggest simple textbox comparisons; that only compares local values and does not prove server-side authentication. For a reliable client-side login flow, the application must verify the server response (redirect, cookie, DOM change, or API token) rather than just comparing textbox text.

Two practical paths:

  • Prefer an API-based login: POST credentials to a dedicated auth endpoint (HttpClient). Check HTTP status or returned token/cookie and show the main form only on success. This avoids brittle DOM automation and works with AJAX/back-end auth.
  • If the WebBrowser control must be used, drive the page and verify the result by inspecting the final document. Wait for the top-level navigation to finish, then look for a stable success signal (known URL, logout link, user name element, or specific text). The WebBrowser.DocumentCompleted event fires more than once for frames; process only when e.Url = WebBrowser.Url. See the WebBrowser.DocumentCompleted notes for details: WebBrowser.DocumentCompleted docs.

Example (VB.NET): programmatically set the page inputs, invoke submit, then on DocumentCompleted check DOM or text for success.

Private Sub btnLogin_Click(...) Handles btnLogin.Click
    Dim doc = WebBrowser1.Document
    If doc Is Nothing Then Exit Sub
    Dim u = doc.GetElementsByName("username")(0)
    Dim p = doc.GetElementsByName("password")(0)
    u?.SetAttribute("value", txtUser.Text)
    p?.SetAttribute("value", txtPass.Text)
    doc.Forms(0).InvokeMember("submit")
End Sub

Private Sub WebBrowser1_DocumentCompleted(sender, e As WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
    If e.Url = WebBrowser1.Url Then
        If WebBrowser1.Document.GetElementById("logout") IsNot Nothing OrElse WebBrowser1.DocumentText.Contains("Welcome") Then
            ' success -> open main form
        ElseIf WebBrowser1.DocumentText.Contains("invalid") Then
            MessageBox.Show("Login failed")
        End If
    End If
End Sub

Troubleshooting notes: many sites use AJAX (no navigation) or dynamic element names—inspect the site with browser dev tools to find stable selectors. Always use HTTPS, avoid storing passwords in plain text, and prefer server-side tokens for authentication (see OWASP Authentication guidance: Authentication Cheat Sheet).

Recommended Answers

All 2 Replies

So if I understand you correctly, all that you want to do is compare the two textboxes and see if they match.

If textbox1.Text == textbox2.Text

Sounds like you just want to do

If TextBox1.Text = "sometext" And TextBox2.Text = "someothertext" Then
            'ok
        Else
            'not ok
        End If
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.