HttpWebRequest does not detect new Vversion of remote file

T

Thomas Weise

My app looks frequently onto a WEB page to check if a newer version is
available.
My code looks like this:

Private Sub ReadHtmlFile()
Dim hwRequest As HttpWebRequest
Dim hwResponse As HttpWebResponse
Dim srUpdate As IO.StreamReader

hwRequest =
CType(WebRequest.Create("http://www.mydomain.com/version.html"),
HttpWebRequest)
hwRequest.AllowAutoRedirect = False
hwResponse = CType(hwRequest.GetResponse, HttpWebResponse)

srUpdate = New IO.StreamReader(hwResponse.GetResponseStream,
Encoding.ASCII
...
End Sub

When the app is launched, it ready the most recent version of "version.html"
from the remote WEB server.
However, when I update "version.html" while the app is running, it does not
obtain the most recent version, but HttpWebResponse returns the outdated
file it read at the first time. Obviously the file is buffered somehow.

Does anybody have a clue how I can get around this?
Best regards, Thomas
 
T

Thomas Weise

HttpWebResponse works ok, it was just me who screwed the results up later in
my app.
Instead of renewing the internal representation of the HTML page, I always
added the newly downloaded text to the one already present.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top