473,396 Members | 2,018 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,396 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 17 '05 #1
1 1299
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 17 '05 #2

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

Similar topics

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...
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....
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...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.