Save webbrowser content to textbox

Ultrawhack

Well-known member
Joined
Jul 5, 2006
Messages
164
Location
Canada
Programming Experience
3-5
I have a webbrowser control on my form.

Clicking a link on my website downloads a text file eg:

http://www.mysite.com/MyDocs/Download.cfm?format=txt&id=3350395&language=English
downloads doc # 3350395.

How can I capture the contents of this downloaded text file directly into the textbox1 on the same form ?

Appreciate any help on this. If there is a better way to achieve this, please let me know.
 
You have the filename when the download occurs. Simply open the file, read the contents into the Text property of the textbox.
 
Thanks JB. I'd like to automate this process, ie: click on the download link and the downloaded file just opens in the textbox.

Thanks for any help
 
Webbrowser automation - download & open file

When I navigate to a particular website page using the webbrowser control on my form

there is a html button on the webpage named "save"

Manually Clicking on the "save" button opens the standard windows "You have chosen to open thisfile.txt" and asks where it should be saved.

How can I automate the webbrowser to automatically click the "save" button, suppress the windows prompt, download the file and then open the downloaded file in a textbox.

Thanks for any assistance
 
That's what I was talking about, in your program when the file is downloaded you have access to the file path on the local machine, simply use a streamreader to read the contents of the file (after the dl is complete) and show it in the textbox
 
Back
Top