Click here to Skip to main content
15,888,454 members
Home / Discussions / C#
   

C#

 
GeneralRe: e-mail files Pin
Heath Stewart27-Jan-04 4:04
protectorHeath Stewart27-Jan-04 4:04 
GeneralRe: e-mail files Pin
Kenneth_i27-Jan-04 14:08
Kenneth_i27-Jan-04 14:08 
GeneralClass Inheritance Pin
Gareth_Hastings26-Jan-04 22:49
Gareth_Hastings26-Jan-04 22:49 
GeneralRe: Class Inheritance Pin
Dmitriy Kostovetskiy26-Jan-04 23:28
Dmitriy Kostovetskiy26-Jan-04 23:28 
GeneralRe: Class Inheritance Pin
Nick Parker27-Jan-04 7:05
protectorNick Parker27-Jan-04 7:05 
GeneralSelect node in a TreeView Pin
thomasa26-Jan-04 22:31
thomasa26-Jan-04 22:31 
GeneralRe: Select node in a TreeView Pin
Heath Stewart27-Jan-04 3:40
protectorHeath Stewart27-Jan-04 3:40 
GeneralRe: Select node in a TreeView Pin
Uwe Keim28-Jan-04 3:09
sitebuilderUwe Keim28-Jan-04 3:09 
GeneralRe: Select node in a TreeView Pin
Heath Stewart28-Jan-04 5:38
protectorHeath Stewart28-Jan-04 5:38 
GeneralRe: Select node in a TreeView Pin
Uwe Keim28-Jan-04 5:46
sitebuilderUwe Keim28-Jan-04 5:46 
QuestionHow to disable a control in MDI form from a child form Pin
okoji Cyril26-Jan-04 20:56
okoji Cyril26-Jan-04 20:56 
AnswerRe: How to disable a control in MDI form from a child form Pin
Heath Stewart27-Jan-04 3:19
protectorHeath Stewart27-Jan-04 3:19 
GeneralC# and Scintilla Pin
yarns26-Jan-04 20:45
yarns26-Jan-04 20:45 
GeneralRe: C# and Scintilla Pin
Uwe Keim28-Jan-04 3:06
sitebuilderUwe Keim28-Jan-04 3:06 
GeneralRe: C# and Scintilla Pin
wonea25-Feb-10 1:49
wonea25-Feb-10 1:49 
QuestionReal-world commercial .NET Applications? Any? Pin
Uwe Keim26-Jan-04 18:13
sitebuilderUwe Keim26-Jan-04 18:13 
AnswerRe: Real-world commercial .NET Applications? Any? Pin
Mazdak26-Jan-04 19:27
Mazdak26-Jan-04 19:27 
GeneralRe: Real-world commercial .NET Applications? Any? Pin
Uwe Keim26-Jan-04 22:12
sitebuilderUwe Keim26-Jan-04 22:12 
AnswerRe: Real-world commercial .NET Applications? Any? Pin
Heath Stewart27-Jan-04 3:11
protectorHeath Stewart27-Jan-04 3:11 
GeneralRe: Real-world commercial .NET Applications? Any? Pin
Uwe Keim27-Jan-04 3:19
sitebuilderUwe Keim27-Jan-04 3:19 
GeneralRe: Real-world commercial .NET Applications? Any? Pin
Nick Parker27-Jan-04 6:49
protectorNick Parker27-Jan-04 6:49 
AnswerRe: Real-world commercial .NET Applications? Any? Pin
John Fisher27-Jan-04 7:08
John Fisher27-Jan-04 7:08 
Questionhow to download file not to change timestamp using HTTP Pin
yu-yu26-Jan-04 17:26
yu-yu26-Jan-04 17:26 
AnswerRe: how to download file not to change timestamp using HTTP Pin
Heath Stewart27-Jan-04 3:02
protectorHeath Stewart27-Jan-04 3:02 
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 HttpWebRequest and 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 FileInfo.LastModified date.

 

-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
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-----
GeneralRe: how to download file not to change timestamp using HTTP Pin
yu-yu27-Jan-04 15:31
yu-yu27-Jan-04 15:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.