AxWebBrowser - problem with caching website.

  • Thread starter Thread starter Vjay77
  • Start date Start date
Can I see the how you coded hte timer event?

Vjay77 said:
When I wrote a refresh button:


Private Sub Button3_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Button3.Click
AxWebBrowser2.Navigate(TextBox2.Text)
AxWebBrowser2.Focus()
SendKeys.Send("{F5}")
End Sub


it worked fine for me too...
but the same code won't work when I try to run it inside of my timer1
cycle... timer goes on every 10 minutes now... it works only first
round...

so this is really interesting... is it dissabled to run in timer by
microsoft?



----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption
=---
 
timer is set to tick every ten minutes:



Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Timer1.Tick
Dim count As Integer

Label1.Text = DateTime.Now
Label2.Text = DateTime.Now
count = count + 1

If count = 1 Then
AxWebBrowser1.Navigate(TextBox1.Text)
AxWebBrowser2.Navigate(TextBox2.Text)
Else
AxWebBrowser1.Navigate(TextBox1.Text)
AxWebBrowser1.Focus()
SendKeys.Send("{F5}")

AxWebBrowser2.Navigate(TextBox2.Text)
AxWebBrowser2.Focus()
SendKeys.Send("{F5}")
End If



End Sub
 
In the timer properites in the designer, enable and set to 10000.

You will need to initiate the timer (timer1.start) after some sort of event
within your application. I know you do not want it during form load.

The reason it crashed initally was that there was nothing there for it to
refresh. After putting in the inital navigate in form load that error went
away.


Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

AxWebBrowser1.Navigate("http://www.gutenberg.net/etext02/8mede10.txt") '
TextBox1.Text = "http://www.gutenberg.net/etext02/8mede10.txt"
End Sub

Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Timer1.Tick
Dim count As Integer
count = count + 1
If count = 1 Then
Dim REFRESH_COMPLETELY As Object = 3
AxWebBrowser1.Refresh2(REFRESH_COMPLETELY)
Else
AxWebBrowser1.Navigate(TextBox1.Text)
End If
End Sub
Vjay77 said:
timer is set to tick every ten minutes:



Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Timer1.Tick
Dim count As Integer

Label1.Text = DateTime.Now
Label2.Text = DateTime.Now
count = count + 1

If count = 1 Then
AxWebBrowser1.Navigate(TextBox1.Text)
AxWebBrowser2.Navigate(TextBox2.Text)
Else
AxWebBrowser1.Navigate(TextBox1.Text)
AxWebBrowser1.Focus()
SendKeys.Send("{F5}")

AxWebBrowser2.Navigate(TextBox2.Text)
AxWebBrowser2.Focus()
SendKeys.Send("{F5}")
End If



End Sub



----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption
=---
 
Thanks for all your help scorpion... it works like a charm now...

What I did wrong and you were right about it, was that I was
refreshing something which didn't exist...
I rewrote the app a bit, so what I do now is that when the program
opens, I select the time interval and I click on start button... And
at this particular moment right after start I load the page first for
a first time and since then on, all I do is that I keep on refreshing
it using your code in those periods of time I set at the begining...

Amazingly simple, especially when you already suggested this right at
the begining... I just overlooked that axwebbrower wasn't loaded
first with the page.

Anyways... code looks like this, maybe for a future someone would like
to see it:





Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Timer1.Tick

Dim REFRESH_COMPLETELY As Object = 3
AxWebBrowser1.Refresh2(REFRESH_COMPLETELY)

End Sub



and initial start button code:

[code:1:61c6aeeffd]
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Button1.Click
Timer1.Start()
AxWebBrowser1.Navigate(TextBox1.Text)
End Sub
[/code:1:61c6aeeffd]


thanks a lot for all your help...
vjay


--- backup at www.dotnetboards.com ---




http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
 
glad I could help vj......

Vjay77 said:
Thanks for all your help scorpion... it works like a charm now...

What I did wrong and you were right about it, was that I was
refreshing something which didn't exist...
I rewrote the app a bit, so what I do now is that when the program
opens, I select the time interval and I click on start button... And
at this particular moment right after start I load the page first for
a first time and since then on, all I do is that I keep on refreshing
it using your code in those periods of time I set at the begining...

Amazingly simple, especially when you already suggested this right at
the begining... I just overlooked that axwebbrower wasn't loaded
first with the page.

Anyways... code looks like this, maybe for a future someone would like
to see it:





Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Timer1.Tick

Dim REFRESH_COMPLETELY As Object = 3
AxWebBrowser1.Refresh2(REFRESH_COMPLETELY)

End Sub



and initial start button code:

[code:1:61c6aeeffd]
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Button1.Click
Timer1.Start()
AxWebBrowser1.Navigate(TextBox1.Text)
End Sub
[/code:1:61c6aeeffd]


thanks a lot for all your help...
vjay


--- backup at www.dotnetboards.com ---



----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption
=---
 
Hi Scorpion,

Very persistent as ever and I changed it already, I did not see there was
webbrowser.refresh2(0) in my program.

And I was not so sure of this to be persistent in my answers.

(I tried it now with webbrowser.refresh2(3) and I thought it did work).

I do not know where you are from, but if you are from the so called western
side of the world.
(Or a culture like that)

Merry Christmas

Cor
 
Thanks Cor,

I am having a good Xmas.

I hope you are the same. It is Christmas you are celebrating right?

On another note Cor, is there a place I can report abuse in this newsgroup?
 
Hi Scorpion,

Don't pay attention to that troll, it is probably only to get a long thread,
not answer at all.

And absolutly don't think you should do what he ask even not on your
website.

I was almost writing something in that thread about that, but I think even
not doing that is better, when you do not answer than the fun is gone for
him.

Cor
 
Back
Top