By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,885 Members | 1,072 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,885 IT Pros & Developers. It's quick & easy.

WebClient, DownloadFile, OpenRead Does not retrive last modify file

P: n/a
Hi-

I am using...

WebClient Client = new WebClient ();
Client.DownloadFile(url, filename);
Or
Stream strm = Client.OpenRead (url);

But, the stream or file download, is not updated, several calls to url
retrive the same file. The file behind url is update each two seconds.

- How recover the most recent version of the file, in each call of
WebClient?


regards,

<ht />
Feb 8 '08 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Disculpas, este posting no era para este grupo en español.. Los afanes.
"Harvey Triana" <es**********@hotmail.comescribió en el mensaje
news:Ol**************@TK2MSFTNGP06.phx.gbl...
Hi-

I am using...

WebClient Client = new WebClient ();
Client.DownloadFile(url, filename);
Or
Stream strm = Client.OpenRead (url);

But, the stream or file download, is not updated, several calls to url
retrive the same file. The file behind url is update each two seconds.

- How recover the most recent version of the file, in each call of
WebClient?


regards,

<ht />


Feb 8 '08 #2

P: n/a
You have a caching problem.

do you have a proxy server between your computer and the server? Usually
they will cache files and return the same file for every request.

Nothing you can do about it except buying bottle of whisky and go to admins
of that proxy :)

George.

"Harvey Triana" <es**********@hotmail.comwrote in message
news:Ol**************@TK2MSFTNGP06.phx.gbl...
Hi-

I am using...

WebClient Client = new WebClient ();
Client.DownloadFile(url, filename);
Or
Stream strm = Client.OpenRead (url);

But, the stream or file download, is not updated, several calls to url
retrive the same file. The file behind url is update each two seconds.

- How recover the most recent version of the file, in each call of
WebClient?


regards,

<ht />


Feb 8 '08 #3

P: n/a
This trap works!
Stream r = wc.OpenRead(Url + "?t="+ DateTime.Now.Ticks.ToString());

Thanks

"George Ter-Saakov" <gt****@cardone.comescribió en el mensaje
news:OU**************@TK2MSFTNGP04.phx.gbl...
You have a caching problem.

do you have a proxy server between your computer and the server? Usually
they will cache files and return the same file for every request.

Nothing you can do about it except buying bottle of whisky and go to
admins of that proxy :)

George.

"Harvey Triana" <es**********@hotmail.comwrote in message
news:Ol**************@TK2MSFTNGP06.phx.gbl...
>Hi-

I am using...

WebClient Client = new WebClient ();
Client.DownloadFile(url, filename);
Or
Stream strm = Client.OpenRead (url);

But, the stream or file download, is not updated, several calls to url
retrive the same file. The file behind url is update each two seconds.

- How recover the most recent version of the file, in each call of
WebClient?


regards,

<ht />



Feb 8 '08 #4

P: n/a
You right, forgot about that trick although using it myself :)

George.
"Harvey Triana" <es**********@hotmail.comwrote in message
news:ur**************@TK2MSFTNGP03.phx.gbl...
This trap works!
Stream r = wc.OpenRead(Url + "?t="+ DateTime.Now.Ticks.ToString());

Thanks

"George Ter-Saakov" <gt****@cardone.comescribió en el mensaje
news:OU**************@TK2MSFTNGP04.phx.gbl...
>You have a caching problem.

do you have a proxy server between your computer and the server? Usually
they will cache files and return the same file for every request.

Nothing you can do about it except buying bottle of whisky and go to
admins of that proxy :)

George.

"Harvey Triana" <es**********@hotmail.comwrote in message
news:Ol**************@TK2MSFTNGP06.phx.gbl...
>>Hi-

I am using...

WebClient Client = new WebClient ();
Client.DownloadFile(url, filename);
Or
Stream strm = Client.OpenRead (url);

But, the stream or file download, is not updated, several calls to url
retrive the same file. The file behind url is update each two seconds.

- How recover the most recent version of the file, in each call of
WebClient?


regards,

<ht />




Feb 8 '08 #5

This discussion thread is closed

Replies have been disabled for this discussion.