473,320 Members | 1,848 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,320 software developers and data experts.

WebClient.DownloadData without cache

YA
I am using WebClient to download a text file from the net every 2 minutes.
The problem is that I think I am reading the file from cache since when the
file is change I still get the old file.
Here is my code:
Dim myWebClient As New WebClient()
Dim responseArray As Byte() = myWebClient.DownloadData(szURL)

How can I tell WebClient not to use cache ?

Thanks in advance
ra***@hotmail.com

Nov 19 '05 #1
1 5576
Two things to try:

1) Server cache control:
..asp page instead of .txt file in your url, .asp includes anti-caching headers ahead of the text file content read from the text
file. see FileSystemObject in ASP to read the file content.

2) make browser think it's a new url:
append "?r=" & rnd * 999999 to the url of the txt file. The web server won't care about the trailing stuff but the browser thinks
it's gonna get a new result and will fetch it. This syntax may not be perfect but you get the idea that a constantly changing
QueryString portion of the URL will make browser keep pulling from the server.

Chris Langsenkamp
http://chat.cleverchat.net/

----- Original Message -----
"YA" <ra***@hotmail.com> wrote in message news:%2***************@tk2msftngp13.phx.gbl...
I am using WebClient to download a text file from the net every 2 minutes.
The problem is that I think I am reading the file from cache since when the
file is change I still get the old file.
Here is my code:
Dim myWebClient As New WebClient()
Dim responseArray As Byte() = myWebClient.DownloadData(szURL)

How can I tell WebClient not to use cache ?

Thanks in advance
ra***@hotmail.com


Nov 19 '05 #2

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

Similar topics

2
by: ScottO | last post by:
How can I upload a file to a ASP.NET page without having the stream eating up memory without using a 3rd party component? How can I download a file from a different webpage without eating up...
2
by: Gary Short | last post by:
Hello group, I was wondering if anyone here could help me with an odd WebClient problem. When I run the following code: WebClient aWebClient = new WebClient(); Byte aBA =...
1
by: yyy | last post by:
This problem bothers me for a long time: I use WebClient.DownloadData in order to read text from an HTML document this way: WebClient c = new WebClient(); string html=...
1
by: ATS | last post by:
ERR - WebClient.DownloadData returns "protocol violation" Please help, I'm getting a "protocol violation" from a site that is working perfectly fine when I issue WebClient.DownloadData as...
1
by: YA | last post by:
I am using WebClient to download a text file from the net every 2 minutes. The problem is that I think I am reading the file from cache since when the file is change I still get the old file. Here...
2
by: Rags | last post by:
Hi We are creating a web application using .NET which renders some reports. The reports are created in MS Reporting Services and can be accessed by typing in a URL with the required parameters...
8
by: DEWright_CA | last post by:
Why does WebClient.DownloadFile loose my completed path? Ok, I have a function in my app then when my button is clicked it checks to see if the files come from a local drive or a http address....
4
by: Crirus | last post by:
Hi there! Fisrt the question: there is a ay to make the DownloadData when I want? I have a WebClient class I use myWebClient.DownloadData(remoteUrl) to connect to internet server All this in...
6
by: Dave Starman | last post by:
Hello, I am trying to download web data into my current application. Failing many attempts I tried to run the sample from the MS Help files with no luck. If I create a new solution and put the...
1
by: jmk | last post by:
I'm trying to use an external SMS-service through .NET Framework 1.1 and using the webClient.DownloadData(strMessage) method. The strMessage is a string consisting the parameters to send a message,...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.