Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
web browser, type the password and user name is incorrect error of the form closes.
input button on the form are not how I should write an error code?

VB
Dim Username, Password As String
       Username = TextBox3.Text
       Password = TextBox4.Text
       Form2.WebBrowser2.Document.GetElementById("email").SetAttribute("Value", Username)
       Form2.WebBrowser2.Document.GetElementById("pass").SetAttribute("Value", Password)
       Form2.WebBrowser2.Document.GetElementById("loginbutton").InvokeMember("click")
       If
          not Form2.WebBrowser2.Document.All.Item("Button3") Is Nothing) then
           MsgBox("Incorrect Username/password , ", 0, "Login error!")</pre>

if. fails down
fails missing article gives warning. please help
Posted
Updated 4-Apr-15 19:57pm
v5
Comments
BacchusBeale 3-Apr-15 16:05pm    
please provide some code and explain where you are having problems.
[no name] 3-Apr-15 16:22pm    
I did a web browser facebook login form. I entered my password incorrectly or e-mail me
therefore form fails and closes form
How should I write a code to get off form?

for example
e-mail or password you entered is incorrect.
Please try again!

I want to be like . I do not want to close with an error of the form.
ZurdoDev 3-Apr-15 16:09pm    
This does not make any sense.
[no name] 3-Apr-15 16:20pm    
I did a web browser facebook login form. I entered my password incorrectly or e-mail me
therefore form fails and closes form
How should I write a code to get off form?

for example
e-mail or password you entered is incorrect.
Please try again!

I want to be like . I do not want to close with an error of the form.

1 solution

You could make/host an error HTML page and redirect (Navigate) to there when there's an error.
 
Share this answer
 
Comments
[no name] 4-Apr-15 17:08pm    
yup. but I don't know how to do
BacchusBeale 4-Apr-15 17:28pm    
If it's a desktop application and you are embedding the web browser the html page can be in local folder. If it's hosted by you or online you need to add the page and navigate to the URL. If winform control use Navigate method; if hosted use JavaScript window.open or window.location.
[no name] 4-Apr-15 17:54pm    
Sorry. I do not understand very well. I find only code I paste form :)

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



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