Here is an example in VB, could someone show me how this can be done in VB.NET in a windows form?
============================================================
I'll use this page in Experts Exchange as an example.
Click Ctrl+T and choose "Microsoft Internet Controls", then add the control to your form. Change the name property to wb.
First you need to navigate to the page by:
wb.navigate2 "
To access forms on this website, you need to parse the pages html source to find the name attribute of the item, either a text box, option buttons, check boxes or submit buttons.
For example, is you wanted to paste some text into the Comment box of this page, you would first look at the source for the code for the comment box:
<textarea name="text" rows=15 cols=48 class=fullWidth></textarea>
The name="text" tag is what your looking for. You can reference the text box by using the name "text" by
wb.Document.All("text").Value = "myText"
This will put the string "myText" into the text box named "text" on the webpage.
If you then want to click the submit button, look at the source
<input type=image name="Submit" src="/images/submitButton.gif" alt="Submit" class=image>
and use the name="Submit" tag to press submit:
wb.Document.All("Submit").Click
A simple test, run the following code and it will navigate to this page and post some text and press submit.
wb.navigate2 "Do
DoEvents
Loop While wb.Busy 'wait for the page to load
wb.Document.All("text").Value = "myText"
wb.Document.All("Submit").Click
==========================================================
thanks.
============================================================
I'll use this page in Experts Exchange as an example.
Click Ctrl+T and choose "Microsoft Internet Controls", then add the control to your form. Change the name property to wb.
First you need to navigate to the page by:
wb.navigate2 "
To access forms on this website, you need to parse the pages html source to find the name attribute of the item, either a text box, option buttons, check boxes or submit buttons.
For example, is you wanted to paste some text into the Comment box of this page, you would first look at the source for the code for the comment box:
<textarea name="text" rows=15 cols=48 class=fullWidth></textarea>
The name="text" tag is what your looking for. You can reference the text box by using the name "text" by
wb.Document.All("text").Value = "myText"
This will put the string "myText" into the text box named "text" on the webpage.
If you then want to click the submit button, look at the source
<input type=image name="Submit" src="/images/submitButton.gif" alt="Submit" class=image>
and use the name="Submit" tag to press submit:
wb.Document.All("Submit").Click
A simple test, run the following code and it will navigate to this page and post some text and press submit.
wb.navigate2 "Do
DoEvents
Loop While wb.Busy 'wait for the page to load
wb.Document.All("text").Value = "myText"
wb.Document.All("Submit").Click
==========================================================
thanks.