Stupid Me

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



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" <thomas@xxxxxxxxxxxxxxxx> schrieb im Newsbeitrag
news:%23GfF428VIHA.1376@xxxxxxxxxxxxxxxxxxxxxxx
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




.



Relevant Pages

  • Re: HTTP Post with .NET CF VB
    ... I'd like to have my app to do a HTTPPost ... Dim sURL As String = "http://yoururl.com"; ... Dim myHttpWebResponse As HttpWebResponse = CType ... Dim streamResponse As Stream = myHttpWebResponse.GetResponseStream ...
    (microsoft.public.dotnet.languages.vb)
  • HttpWebRequest does not detect new Vversion of remote file
    ... Dim hwRequest As HttpWebRequest ... Dim hwResponse As HttpWebResponse ... When the app is launched, it ready the most recent version of "version.html" ...
    (microsoft.public.dotnet.languages.vb)
  • Re: HttpWebRequest / Response disconnect question
    ... Close method of HttpWebResponse. ... response object - Closeis called in the ConnectStream. ... This works fine -- every 10k I check if the client is ... and the first bit of of data is pushed to the app. ...
    (microsoft.public.dotnet.framework)
  • HttpWebRequest issue
    ... from this app http://www.rexswain.com/httpview.html, then this app ... gets the error response successfully i.e. ... I have tried many http header settings for my request but I cannot ... HttpWebResponse response = ...
    (microsoft.public.dotnet.framework)
  • Re: HTTPWebRequest fails
    ... I have tested the connection with the Cmhelper ... and the same web request I am trying from my app. ... Dim res As HttpWebResponse ...
    (microsoft.public.pocketpc.developer)