473,326 Members | 2,013 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

WebBrowser1.ReadyState problem

1
hi
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
  1. While (WebBrowser1.ReadyState <> WebBrowserReadyState.Complete)
  2.                     Application.DoEvents()
  3.                 End While
but when i use an other code to click submit. it is not waiting webbrowser1's loading time.

this code is for clicking submit buton
Expand|Select|Wrap|Line Numbers
  1.                Dim theWElementCollection As HtmlElementCollection = WebBrowser1.Document.GetElementsByTagName("input")
  2.                 For Each curElement As HtmlElement In theWElementCollection
  3.  
  4.  
  5.                     Dim controltick As String = curElement.GetAttribute("name").ToString
  6.                     If controltick = "stickunstick" Then
  7.                         curElement.InvokeMember("click")
  8.                     End If
  9.                     Dim controlName As String = curElement.GetAttribute("name").ToString
  10.                     If controlName = "sbutton" Then
  11.                         curElement.InvokeMember("click")
  12.                     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
  1.               WebBrowser1.Document.All("subject").InnerText = TextBox6.Text
  2.                 WebBrowser1.Document.All("vB_Editor_001_textarea").InnerText = TeknikTextBox.Text
  3.  
  4.  
  5.                 Dim theWElementCollection As HtmlElementCollection = WebBrowser1.Document.GetElementsByTagName("input")
  6.                 For Each curElement As HtmlElement In theWElementCollection
  7.  
  8.  
  9.                     Dim controltick As String = curElement.GetAttribute("name").ToString
  10.                     If controltick = "stickunstick" Then
  11.                         curElement.InvokeMember("click")
  12.                     End If
  13.                     Dim controlName As String = curElement.GetAttribute("name").ToString
  14.                     If controlName = "sbutton" Then
  15.                         curElement.InvokeMember("click")
  16.                     End If
  17.                     While (WebBrowser1.ReadyState <> WebBrowserReadyState.Complete)
  18.                         Application.DoEvents()
  19.                     End While
  20.  
  21.                 Next
  22.  
  23.                 While (WebBrowser1.ReadyState <> WebBrowserReadyState.Complete)
  24.                     Application.DoEvents()
  25.                 End While
  26.  
  27.  
Jun 5 '10 #1
0 1953

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Mark | last post by:
I am at my wits' end. I have the following code: WebBrowser1.Navigate ("c:\path\page.htm") Text1.Text = WebBrowser1.Document.Links.length Where the page.htm has the following HTML: <html>
1
by: Michael J Whitmore | last post by:
I am getting tired of losing hair over this. Here is a function that simply inserts one of three images into a document right before printing. It is called for every element that has a specific...
0
by: JohnT | last post by:
Hello all, Please excuse my ignorance, but I'm a newb. I was creating my first windows form app as described in the help file. I'm fairly certain that I entered everything as I was supposed to,...
16
by: nime | last post by:
How can I grab html source of a frame? I can retrive main frame by WebBrowser1.DocumentText but I want to retrive inner (child) frame... WebBrowser1.Document.Window.Frames(0).DocumentText like...
2
by: coolvirus | last post by:
I'm using the XMLHTTPRequest JavaScript object to fetch updated info from the server. The problem I'm having occurs on Windows 2000/IE 6. There is a very long pause on readyState 3 (close to a...
9
by: tshad | last post by:
This was posted before but the message got messed up (all NLs were stripped out for some reason). I have 2 labels that hold the name of different images on my .aspx page. <asp:Label ID="Logo"...
0
by: fadetoblack | last post by:
The code below is working to a point. At the http_request.readyState statement I get a state of one. How do I complete the process so I can get a state of four and/or another means of getting a value...
0
by: sejal17 | last post by:
Hello everyone, i have a problem with getting a print out of iframe in asp.net with language c#. an iframe contain a data from diffrent page(docoment1.htm). can any one help me in this...
2
by: electroman | last post by:
Hello! I am having a very weird problem that I cant find any solution on the Internet (after so many years!). I am trying to code a C# program and I am using the WebBroswer control. The code is...
1
by: phpfreak2007 | last post by:
Hello, I want screenshot of website by passing url. I used the DrawtoBitmap method of webbrowser but it is not working properly. It gives empty images. I want screenshot of websites which i...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.