i am writing a auto login program. but after my program finish login automaticly it will continue with an other login. but it have to wait webbrowser1 loading time. normally i am using this code to wait webbrowser1's loading time.
Expand|Select|Wrap|Line Numbers
- While (WebBrowser1.ReadyState <> WebBrowserReadyState.Complete)
- Application.DoEvents()
- End While
this code is for clicking submit buton
Expand|Select|Wrap|Line Numbers
- Dim theWElementCollection As HtmlElementCollection = WebBrowser1.Document.GetElementsByTagName("input")
- For Each curElement As HtmlElement In theWElementCollection
- Dim controltick As String = curElement.GetAttribute("name").ToString
- If controltick = "stickunstick" Then
- curElement.InvokeMember("click")
- End If
- Dim controlName As String = curElement.GetAttribute("name").ToString
- If controlName = "sbutton" Then
- curElement.InvokeMember("click")
- End If
pls help me about this. i don't know what can i do.
also this is my all codes
Expand|Select|Wrap|Line Numbers
- WebBrowser1.Document.All("subject").InnerText = TextBox6.Text
- WebBrowser1.Document.All("vB_Editor_001_textarea").InnerText = TeknikTextBox.Text
- Dim theWElementCollection As HtmlElementCollection = WebBrowser1.Document.GetElementsByTagName("input")
- For Each curElement As HtmlElement In theWElementCollection
- Dim controltick As String = curElement.GetAttribute("name").ToString
- If controltick = "stickunstick" Then
- curElement.InvokeMember("click")
- End If
- Dim controlName As String = curElement.GetAttribute("name").ToString
- If controlName = "sbutton" Then
- curElement.InvokeMember("click")
- End If
- While (WebBrowser1.ReadyState <> WebBrowserReadyState.Complete)
- Application.DoEvents()
- End While
- Next
- While (WebBrowser1.ReadyState <> WebBrowserReadyState.Complete)
- Application.DoEvents()
- End While