WebBrowser navigate()

FuZion

Well-known member
Joined
Jan 28, 2007
Messages
47
Programming Experience
Beginner
Hello,

I have a timer that fires every 3 minutes(180,000 milliseconds), when this timer fires I have it set to navigate a web browser to a URL, I need this web script to be called every 3 minutes. The web browser is declared through
VB.NET:
dim browser as new webBrowser

Is there a reason this isn't working?

Thanks alot,

FuZion
 
Is there a reason this isn't working?
No. Is your only other code browser.Navigate(address) ? If it's more complex than that you might have to give us some more info..
 
That's correct, I have the timer set to fire every three minutes and the timer.onTick event contains browser.navigate(Address) and thats it. I was playing around and I figured out that it works on the form load event, but not with the timer.
 
onTick isn't an event, it is the internal sub method of Timer class that raises the Tick event. What you say sounds diffuse, you have to give any helper more to work with.

What you can do in Designer is to set the Timer properties Enabled to True and Interval to 5000, then doubleclick the Timer component, when you are now brought to the Tick event handler you write in for example MsgBox("Hello timer!"). Start the application and wait for the messagebox to display. There is no reason the browser.navigate would behave differently than the message box call.
 
If the script you're running doesn't give you any visual feedback (IE database update or what have you) you might also use:


VB.NET:
Dim xmlhttp = CreateObject("Microsoft.XMLHTTP")
xmlhttp.Open "GET", "http://pathtoyourscript", False
xmlhttp.Send
xmlhttp.Close
I've used this in a service for a webbased game I have running. Basically it just runs a script which updates the db.
 
CreateObject("Microsoft.XMLHTTP")
We have the System.Net.WebClient for that in .Net Framework in case you didn't know. Also System.Net.WebRequest for more advanced cases. But the .Net 2.0 WebBrowser control works also fine without UI.
 
Back
Top