If webpage contains text like "username invalid"...
If you need help with a project or need to know how to do something specific in VB.NET then please ask your questions in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
7 posts
Page 1 of 1
Hi, Sorry for the subject but I didn't know what better to put...
Well, I have a register form in my vb and I'd like to know how to put this:
If when a user click register and in webpage appears a text saing; your username is invalid. choose another one.
The webbrowser is hide in the form, because I 'redirect' the white spaces to textbox's and submit button to a button1.
I'd like to know how to inform that user (with a msgbox or something) that his username is invalid. How to do this ?
Sorry my english :s
EDIT: here is the register webpage: http://patrickcosta.forumeiros.com/regi ... rue&step=2
Well, I have a register form in my vb and I'd like to know how to put this:
If when a user click register and in webpage appears a text saing; your username is invalid. choose another one.
The webbrowser is hide in the form, because I 'redirect' the white spaces to textbox's and submit button to a button1.
I'd like to know how to inform that user (with a msgbox or something) that his username is invalid. How to do this ?
Sorry my english :s
EDIT: here is the register webpage: http://patrickcosta.forumeiros.com/regi ... rue&step=2
something like this:
Code: Select all
You can put the textboxes and the submit button behind the web browser.if webbrowser1.documenttext.contains("Your username is invalid") then
webbrowser1.visible = false
msgbox("The username/password is invalid")
end if
thanks for the answer but I didn't explained, sorry:
when I click in register button the page will go to another one and I want to search if that words are in that new page . confuse ? :S
Thanks in Advance
when I click in register button the page will go to another one and I want to search if that words are in that new page . confuse ? :S
Thanks in Advance
i think you can use the code i gave you in the web browser's page_load (or something like that) event.
Actually, you might want to place it in the WebBrowser DocumentCompleted event so that it executes the code when the page has finished loading.
Code: Select all
Something like that I guessPrivate Sub WebBrowser1_DocumentCompleted(ByVal sender As Object, ByVal e As WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
If WebBrowser1.DocumentText.Contains("Your username is invalid") Then
MessageBox.Show("The username you chose is invalid")
End If
End Sub
LMAOSHMSFOAIDMT
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;
Over 30 projects with source code!
Please give reputation to helpful members!
![Image]()
![Image]()
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;
Over 30 projects with source code!
Please give reputation to helpful members!

MrAksel wrote:Using this code it will search "Your username is invalid" every pages or only in the first ?Code: Select allSomething like that I guessPrivate Sub WebBrowser1_DocumentCompleted(ByVal sender As Object, ByVal e As WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted If WebBrowser1.DocumentText.Contains("Your username is invalid") Then MessageBox.Show("The username you chose is invalid") End If End Sub
Thanks everyone

EDIT: I tested now and was this I was searching!
7 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023