Click here to Skip to main content
15,904,023 members
Home / Discussions / C#
   

C#

 
AnswerRe: Form_Load event problem Pin
Mycroft Holmes27-Aug-09 14:46
professionalMycroft Holmes27-Aug-09 14:46 
QuestionHow to limit the number of simultaneously connected clients Pin
Frozzeg27-Aug-09 3:59
Frozzeg27-Aug-09 3:59 
GeneralRe: How to limit the number of simultaneously connected clients Pin
harold aptroot27-Aug-09 4:02
harold aptroot27-Aug-09 4:02 
GeneralRe: How to limit the number of simultaneously connected clients Pin
Frozzeg27-Aug-09 4:16
Frozzeg27-Aug-09 4:16 
AnswerRe: How to limit the number of simultaneously connected clients Pin
Nagy Vilmos27-Aug-09 4:21
professionalNagy Vilmos27-Aug-09 4:21 
GeneralRe: How to limit the number of simultaneously connected clients Pin
harold aptroot27-Aug-09 4:30
harold aptroot27-Aug-09 4:30 
GeneralRe: How to limit the number of simultaneously connected clients Pin
Frozzeg27-Aug-09 5:23
Frozzeg27-Aug-09 5:23 
QuestionCreate txt file with date as name [Solved] Pin
mostofmonty27-Aug-09 3:35
mostofmonty27-Aug-09 3:35 
I am very new to C#, and i just want to create a .txt file with the current date and time as the filename.

Here is the code i've put together from bits and pieces on the net, and it isnt working

string date = DateTime.Now.ToString("yyyyMMdd_hhmmss");
TextWriter tw = new StreamWriter("{0}.txt", date); 


I have also tried

TextWriter tw = new StreamWriter(DateTime.Now.ToString("yyyyMMdd_hhmmss.txt"));


It creates the filename i want, but with the .pxp extension instead of the .txt

Any help would be greatly appreciated Smile | :)

modified on Thursday, August 27, 2009 10:24 AM

AnswerRe: Create txt file with date as name Pin
Calla27-Aug-09 3:39
Calla27-Aug-09 3:39 
AnswerRe: Create txt file with date as name Pin
OriginalGriff27-Aug-09 3:42
mveOriginalGriff27-Aug-09 3:42 
GeneralRe: Create txt file with date as name Pin
mostofmonty27-Aug-09 3:49
mostofmonty27-Aug-09 3:49 
GeneralRe: Create txt file with date as name Pin
OriginalGriff27-Aug-09 3:54
mveOriginalGriff27-Aug-09 3:54 
GeneralRe: Create txt file with date as name Pin
mostofmonty27-Aug-09 3:59
mostofmonty27-Aug-09 3:59 
GeneralRe: Create txt file with date as name Pin
OriginalGriff27-Aug-09 4:11
mveOriginalGriff27-Aug-09 4:11 
GeneralRe: Create txt file with date as name Pin
mostofmonty27-Aug-09 4:24
mostofmonty27-Aug-09 4:24 
AnswerRe: Create txt file with date as name Pin
musefan27-Aug-09 3:47
musefan27-Aug-09 3:47 
GeneralRe: Create txt file with date as name Pin
harold aptroot27-Aug-09 4:01
harold aptroot27-Aug-09 4:01 
GeneralRe: Create txt file with date as name Pin
musefan27-Aug-09 5:59
musefan27-Aug-09 5:59 
GeneralRe: Create txt file with date as name Pin
mostofmonty27-Aug-09 4:11
mostofmonty27-Aug-09 4:11 
AnswerRe: Create txt file with date as name [Solved] [modified] Pin
PIEBALDconsult27-Aug-09 8:41
mvePIEBALDconsult27-Aug-09 8:41 
GeneralRe: Create txt file with date as name [Solved] Pin
mostofmonty28-Aug-09 3:00
mostofmonty28-Aug-09 3:00 
GeneralRe: Create txt file with date as name [Solved] Pin
PIEBALDconsult28-Aug-09 6:26
mvePIEBALDconsult28-Aug-09 6:26 
Questionbool condition Pin
Tauseef A27-Aug-09 2:10
Tauseef A27-Aug-09 2:10 
AnswerRe: bool condition Pin
musefan27-Aug-09 2:22
musefan27-Aug-09 2:22 
QuestionHow to pass apostrophe to .Trim() Method Pin
xodeblack27-Aug-09 2:00
xodeblack27-Aug-09 2:00 

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.