|Do you mean the timestamp of the original file on your filesystem, or do you want to use the timestamp of the file that was on the server?
In the former case, if the file exists (see
File.Exists) get the last modification date by using a
FileInfo that points to it and store the
FileInfo.LastWriteTime. After you finish writing the file, set the
FileInfo.LastWriteTime to the
DateTime you stored previously.
In the latter case, don't use the
WebClient; use the
HttpWebResponse which are very easy to use and very robust. They are built on the asynchronous pluggable protocol system of .NET and if you look at the documentation for either of those you will find many useful examples.
So, after you make your request and call
HttpWebRequest.GetResponse (and cast it to a
HttpWebResponse), you can get the
HttpWebResponse.LastModified date. AFter you write the file using a buffer, again create a
FileInfo instance pointing to that download file and set the
-----BEGIN GEEK CODE BLOCK-----
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----