question about WebBrowser control?
I've VB6 code like that :
vb Code:
WebBrowser1.Document.All("username").Value = "my_username"
WebBrowser1.Document.All("passwd").Value = "my_password"
WebBrowser1.Document.Forms(0).Submit
WebBrowser1.Navigate "http://360.yahoo.com"
So in this code , it'll navigate http://360.yahoo.com before the form is submit to login . So how can I make it navigate another page after the form is already submited and all the page is loaded ?
Re: question about WebBrowser control?
Quote:
Originally Posted by ghostshadow189
I've VB6 code like that :
vb Code:
WebBrowser1.Document.All("username").Value = "my_username"
WebBrowser1.Document.All("passwd").Value = "my_password"
WebBrowser1.Document.Forms(0).Submit
WebBrowser1.Navigate "http://360.yahoo.com"
So in this code , it'll navigate
http://360.yahoo.com before the form is submit to login . So how can I make it navigate another page after the form is already submited and all the page is loaded ?
In the WebBrowser1 DocumentComplete add:
Code:
If Redirected = False Then
WebBrowser1.Navigate "http://gotosomewheresite.com"
End If
Hope that helps.
Re: question about WebBrowser control?
thanx , but what's Redirected variable ?
Re: question about WebBrowser control?
Quote:
Originally Posted by ghostshadow189
thanx , but what's Redirected variable ?
Where is that coming from?
Re: question about WebBrowser control?
can u explain more clearly? i c that there no Redirected property of WebBrowser ?
Re: question about WebBrowser control?
Quote:
Originally Posted by ghostshadow189
can u explain more clearly? i c that there no Redirected property of WebBrowser ?
Redirect is the variable that will stop the browser from doing an infinite navigation.
In other words:
Put the code below in your Form_Load:
Code:
Dim Redirected as Boolean
Redirected = False
Then in your WebBrowser1_DocumentComplete event put the code below:
Code:
If Redirected = False Then
WebBrowser1.Navigate "http://gotosomewheresite.com"
Redirected = True
End If