AxWebBrowser - problem with caching website.

  • Thread starter Thread starter Vjay77
  • Start date Start date
V

Vjay77

I have a timer which triggers AxWebBrowser1 every 5 minutes to visit
one of my websites.

What I find out later in my websites logs, was, that it really visited
my website only for the first time.

Second time it went to the site and every other time, it was reloaded
probably from the cache, hdd or from somewhere... I am just guessing.


This is something I couldn't resolve and its killing me as I am
spending too much time with this little thing.

I tried to use refresh and update as you see... but these wouldn't
work.
I even tried to go to blank page first and then to my website...still
caching ...

If I restart the whole application it again works for a first time it
visits the page... drives me mad :)


This is my code:

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

Label1.Text = DateTime.Now
AxWebBrowser1.Navigate(TextBox1.Text)
AxWebBrowser1.Refresh()
AxWebBrowser1.Update()

End Sub

Every help much appreciated.

Vjay
 
Hi Vjay,

I am not sure, I thought I had the same problems, but you can try the

axwebbrowser.refresh2(3)

method, that should do it, but I am in doubt.

Tell me if it works, will you?

Cor
 
I don't know how to do what you want to do.
I just wonder if Microsoft have designed their products
to avoid programmers being able to do that easily because
it might allow an ill intentioned programmer to overload
any server he wanted to, just put a very short timer and
set up a few clients to load pages from the server every
few milliseconds. I am not suggesting you have any
intention of wanting to do that, just that it might be
why it is difficult to find a technical solution to do it.
In fact I don't have an answer to your question, I am
just curious to know if it is possible to do it.
Best Regards, Tony
 
Daer Cor,
refresh2 doesn't work either?

Tony:
you might be right, but it wouldn't let me update them even in 5
minutes intervals. Sux badly.

Any other ideas?

Thanks for trying to help.

vjay
 
you might try changing a setting in Internet Explorer - Tools/Internet
Options - then under Settings button - Check for newer versions of stored
pages - select "Every visit to the page". I believe this is stored in
registry @ Current User\Software\Microsoft\Windows\CurrentVersion\Internet
Settings\SyncMode5 so that you can check value (and change) in program if
needed. (key doesn't look it exists until you first change the value in
Internet Explorer)


Vjay77 said:
I have a timer which triggers AxWebBrowser1 every 5 minutes to visit
one of my websites.

What I find out later in my websites logs, was, that it really visited
my website only for the first time.

Second time it went to the site and every other time, it was reloaded
probably from the cache, hdd or from somewhere... I am just guessing.


This is something I couldn't resolve and its killing me as I am
spending too much time with this little thing.

I tried to use refresh and update as you see... but these wouldn't
work.
I even tried to go to blank page first and then to my website...still
caching ...

If I restart the whole application it again works for a first time it
visits the page... drives me mad :)


This is my code:

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

Label1.Text = DateTime.Now
AxWebBrowser1.Navigate(TextBox1.Text)
AxWebBrowser1.Refresh()
AxWebBrowser1.Update()

End Sub

Every help much appreciated.

Vjay



----== 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
=---
 
These are exactly the same problems as I have experienced with vb.net
while trying to use smtp authorization...
simply wouldn't work

I hope someone will help you.

Martin
 
Dan,

I tried what you suggested but Current
User\Software\Microsoft\Windows\CurrentVersion\Internet
Settings\SyncMode5 doesn't exist in win xp home registries, or I am
blind but really can't find it.
I was able to get only to Current
User\Software\Microsoft\Windows\CurrentVersion\Internet
Settings\ but 'SyncMode5' is not there.

Then, I have changed settings in internet explorer as per what you
said, and it finally fixed the problem. Now I would need to figure
out how to do this programmatically, is there any other way to do
this? or any other path in registries?

Thanks for all you help.
Vjay
 
double-check to see if the registry key is there now - I just checked a Win
XP home machine - it didn't exist initially but once I changed the setting
in IE - it appears in the registry.

I am running this on an internal system that I have control over- if I
needed to distribute this to a client I might be worry about counting on
that registry key always existing (and working) with every upgrade to
windows - maybe someone else can chime in on using this...

anyway this is what I use to check in code - you can change GetValue to
SetValue to actually change the key.

Imports Microsoft.Win32

Dim regKey As RegistryKey
Dim dResult As Int16
regKey =
Registry.CurrentUser.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\I
nternet Settings", True)
dResult = Convert.ToInt16(regKey.GetValue("SyncMode5", 0))
If dResult <> 3 Then
MessageBox.Show("Browser not configured properly")
End If
regKey.Close()

Vjay77 said:
Dan,

I tried what you suggested but Current
User\Software\Microsoft\Windows\CurrentVersion\Internet
Settings\SyncMode5 doesn't exist in win xp home registries, or I am
blind but really can't find it.
I was able to get only to Current
User\Software\Microsoft\Windows\CurrentVersion\Internet
Settings\ but 'SyncMode5' is not there.

Then, I have changed settings in internet explorer as per what you
said, and it finally fixed the problem. Now I would need to figure
out how to do this programmatically, is there any other way to do
this? or any other path in registries?

Thanks for all you help.
Vjay



----== 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 Dan.
This is really good to know.
Thanks for your time.

I hope someone will find out how to refresh the axwebbrowser properly,
so I don't have to go through these troubles with setting registries
and checking if they exist or not... that is not the best...

there must be some programmatic way of doing it using axwebbrowser
properties...

hm..

Hope someone can find this challanging...

vjay
 
Hi Vjay,
there must be some programmatic way of doing it using axwebbrowser
properties...
Hope someone can find this challanging...

I did already, but the webbrowser is just using IE.
I thought that in the next version of VB.net there will be a seperated
webbrowser.

But I was hoping I was wrong and you did find the way

I did not do what Dan was advising, for two reasons

Because of that this Microsoft can change it everyday if they think it is a
security problem, without have to think on other developers.
Because the user does not know what you are doing in his settings and that
can give problems (When it is an "in house" program that is a less problem I
asume)

:-))

Cor
 
Cor,
this application will be eventually used just for my own purposes as
it looks right now.
So I assume this is the end to this debate?
No one else has anything else to add?

vjay
 
Vjay,

I assume you have tried:
WebBrowser1.Navigate2 http://www.yahoo.com navNoReadFromCache

not sure on the syntax as I dont have a book by me.

Vjay77 said:
Cor,
this application will be eventually used just for my own purposes as
it looks right now.
So I assume this is the end to this debate?
No one else has anything else to add?

vjay



----== 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
=---
 
A Refresh2 method accepts an argument that determines the refresh level.
This refresh level argument can have one of the following values:

REFRESH_NORMAL 0
REFRESH_IFEXPIRED 1
REFRESH_COMPLETELY 3

Thus

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

Let me know if this helped.

Vjay77 said:
I have a timer which triggers AxWebBrowser1 every 5 minutes to visit
one of my websites.

What I find out later in my websites logs, was, that it really visited
my website only for the first time.

Second time it went to the site and every other time, it was reloaded
probably from the cache, hdd or from somewhere... I am just guessing.


This is something I couldn't resolve and its killing me as I am
spending too much time with this little thing.

I tried to use refresh and update as you see... but these wouldn't
work.
I even tried to go to blank page first and then to my website...still
caching ...

If I restart the whole application it again works for a first time it
visits the page... drives me mad :)


This is my code:

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

Label1.Text = DateTime.Now
AxWebBrowser1.Navigate(TextBox1.Text)
AxWebBrowser1.Refresh()
AxWebBrowser1.Update()

End Sub

Every help much appreciated.

Vjay



----== 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
=---
 
Ok I wrote it like you suggested


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


It gave me unspecified error it simply crashed.

Then I tried to load the page first and than refresh it, like this:

[code:1:51d5a1a418]
AxWebBrowser1.Navigate(TextBox1.Text)
Dim REFRESH_COMPLETELY As Object = 3
AxWebBrowser1.Refresh2(REFRESH_COMPLETELY)
[/code:1:51d5a1a418]


But it still crashed on me. Refresh2 is probably not the best idea...


Then I tried:

[code:1:51d5a1a418]
AxWebBrowser1.Focus()
SendKeys.Send("F5")
[/code:1:51d5a1a418]

Nothing works.
Drives me mad :(

Vjay




http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
 
Try Navigate2

sorry it didnt work out for you this time.

Vjay77 said:
Ok I wrote it like you suggested


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


It gave me unspecified error it simply crashed.

Then I tried to load the page first and than refresh it, like this:

[code:1:51d5a1a418]
AxWebBrowser1.Navigate(TextBox1.Text)
Dim REFRESH_COMPLETELY As Object = 3
AxWebBrowser1.Refresh2(REFRESH_COMPLETELY)
[/code:1:51d5a1a418]


But it still crashed on me. Refresh2 is probably not the best idea...


Then I tried:

[code:1:51d5a1a418]
AxWebBrowser1.Focus()
SendKeys.Send("F5")
[/code:1:51d5a1a418]

Nothing works.
Drives me mad :(

Vjay



----== 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
=---
 
this worked perfectly for me.....

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
TextBox1.Text = "http://www.yahoo.com"

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
AxWebBrowser1.Navigate(TextBox1.Text)

End Sub


Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
Dim REFRESH_COMPLETELY As Object = 3
AxWebBrowser1.Refresh2(REFRESH_COMPLETELY)
End Sub


If it does not work now I will do with a timer tomorrow.

Vjay77 said:
Ok I wrote it like you suggested


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


It gave me unspecified error it simply crashed.

Then I tried to load the page first and than refresh it, like this:

[code:1:51d5a1a418]
AxWebBrowser1.Navigate(TextBox1.Text)
Dim REFRESH_COMPLETELY As Object = 3
AxWebBrowser1.Refresh2(REFRESH_COMPLETELY)
[/code:1:51d5a1a418]


But it still crashed on me. Refresh2 is probably not the best idea...


Then I tried:

[code:1:51d5a1a418]
AxWebBrowser1.Focus()
SendKeys.Send("F5")
[/code:1:51d5a1a418]

Nothing works.
Drives me mad :(

Vjay



----== 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
=---
 
You see, if you're loading yahoo then it's maybe too small for you to
see if it really refreshed and loaded again or if it just loads from
memory.
But I am loading quite a big processing part (takes like minute to
load if refreshed), for me it apears in less than second if it's
coming from cache.

Maybe you should load some bigger text. Try some online text book,
like this dictionary:
http://www.gutenberg.net/etext02/8mede10.txt
it has one megabyte so you'll see the progress.

Anyways, the way you did it, doesn't work in timer for sure.

Let me know if you can come back with something working.
There must be a way, and we should be able to figure this out.

Thanks a lot.

Vjay


Backup of this forum here:
http://www.dotnetboards.com/viewtopic.php?t=5478
 
stand by V may take a minute or so.......

Vjay77 said:
You see, if you're loading yahoo then it's maybe too small for you to
see if it really refreshed and loaded again or if it just loads from
memory.
But I am loading quite a big processing part (takes like minute to
load if refreshed), for me it apears in less than second if it's
coming from cache.

Maybe you should load some bigger text. Try some online text book,
like this dictionary:
http://www.gutenberg.net/etext02/8mede10.txt
it has one megabyte so you'll see the progress.

Anyways, the way you did it, doesn't work in timer for sure.

Let me know if you can come back with something working.
There must be a way, and we should be able to figure this out.

Thanks a lot.

Vjay


Backup of this forum here:
http://www.dotnetboards.com/viewtopic.php?t=5478



----== 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
=---
 
V,

It worked perfectly I am telling you..........

Send an email to (e-mail address removed)

and I will send the project.(remove no spam here)

Something is not right here........



Vjay77 said:
You see, if you're loading yahoo then it's maybe too small for you to
see if it really refreshed and loaded again or if it just loads from
memory.
But I am loading quite a big processing part (takes like minute to
load if refreshed), for me it apears in less than second if it's
coming from cache.

Maybe you should load some bigger text. Try some online text book,
like this dictionary:
http://www.gutenberg.net/etext02/8mede10.txt
it has one megabyte so you'll see the progress.

Anyways, the way you did it, doesn't work in timer for sure.

Let me know if you can come back with something working.
There must be a way, and we should be able to figure this out.

Thanks a lot.

Vjay


Backup of this forum here:
http://www.dotnetboards.com/viewtopic.php?t=5478



----== 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
=---
 
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?
 
Back
Top