473,387 Members | 1,510 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

HttpWebRequest does not detect new Vversion of remote file

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
Jan 15 '08 #1
1 1463
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.

"Thomas Weise" <th****@data-download.deschrieb im Newsbeitrag
news:%2****************@TK2MSFTNGP02.phx.gbl...
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


Jan 16 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: thomas peter | last post by:
I am building a precache engine... one that request over 100 pages on an remote server to cache them remotely... can i use the HttpWebRequest and WebResponse classes for this? or must i use the...
4
by: R Reyes | last post by:
I am trying to code a file uploader (for forum/email attachments) from the client computer to a remote web server via the PUT method (since POST is not allowed ). However, the upload works ONLY...
15
by: warlord | last post by:
I have a windows client app that is trying to download a file from a web server but I always get the following error when I call the GetResponse method of the Request object. The remote server...
7
by: Marc Bartsch | last post by:
Hi, I have a background worker in my C# app that makes a synchronous HttpWebRequest.GetResponse() call. The idea is to POST a file to a server on the internet. When I call HttpWebRequest.Abort()...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.