Click here to Skip to main content
15,900,816 members
Home / Discussions / C#
   

C#

 
AnswerRe: writing in a file Pin
WillemM9-Jan-07 6:17
WillemM9-Jan-07 6:17 
GeneralRe: writing in a file Pin
netJP12L9-Jan-07 6:29
netJP12L9-Jan-07 6:29 
GeneralRe: writing in a file Pin
WillemM9-Jan-07 7:04
WillemM9-Jan-07 7:04 
AnswerRe: writing in a file Pin
Dave Kreskowiak9-Jan-07 6:28
mveDave Kreskowiak9-Jan-07 6:28 
AnswerRe: writing in a file Pin
Luc Pattyn9-Jan-07 7:21
sitebuilderLuc Pattyn9-Jan-07 7:21 
GeneralRe: writing in a file Pin
netJP12L9-Jan-07 8:43
netJP12L9-Jan-07 8:43 
GeneralRe: writing in a file Pin
Martin#9-Jan-07 9:09
Martin#9-Jan-07 9:09 
GeneralRe: writing in a file Pin
Luc Pattyn9-Jan-07 9:47
sitebuilderLuc Pattyn9-Jan-07 9:47 
Yes, you should create only one streamwriter, then have the loop, or whatever makes
up the file's content, then sw.Close().

And sw.Flush() is not doing anything useful here.
It is useful only when the content generation takes a long time, so you
want to force the sw to already send to file what it currently contains; it is
impled by a sw.Close(): when closing the sw, everything it still holds is flushed,
i.e. sent to the file.


If you are used to C (or some similar language), you can compare the StreamWriter you
are using to a regular file with functions fopen, fwrite, fclose (and optionally fflush).

Smile | :)

Luc Pattyn

QuestionValue of SW_SHOWNOACTIVATE!!! Pin
kmuthuk9-Jan-07 4:19
kmuthuk9-Jan-07 4:19 
AnswerRe: Value of SW_SHOWNOACTIVATE!!! Pin
Luc Pattyn9-Jan-07 4:27
sitebuilderLuc Pattyn9-Jan-07 4:27 
GeneralRe: Value of SW_SHOWNOACTIVATE!!! Pin
kmuthuk9-Jan-07 4:28
kmuthuk9-Jan-07 4:28 
GeneralRe: Value of SW_SHOWNOACTIVATE!!! Pin
Luc Pattyn9-Jan-07 4:39
sitebuilderLuc Pattyn9-Jan-07 4:39 
AnswerRe: Value of SW_SHOWNOACTIVATE!!! Pin
Pete O'Hanlon9-Jan-07 4:27
mvePete O'Hanlon9-Jan-07 4:27 
QuestionWAV file management [modified] Pin
Amit D9-Jan-07 4:09
Amit D9-Jan-07 4:09 
QuestionHi............. Pin
Exelioindia9-Jan-07 3:37
Exelioindia9-Jan-07 3:37 
AnswerRe: Hi............. Pin
Rob Graham9-Jan-07 3:56
Rob Graham9-Jan-07 3:56 
AnswerRe: Hi............. Pin
Not Active9-Jan-07 3:58
mentorNot Active9-Jan-07 3:58 
Questionactual Subversion Revision [modified] Pin
Martin#9-Jan-07 3:35
Martin#9-Jan-07 3:35 
AnswerRe: actual Subversion Revision Pin
Daniel Grunwald9-Jan-07 6:06
Daniel Grunwald9-Jan-07 6:06 
GeneralRe: actual Subversion Revision Pin
Martin#9-Jan-07 8:35
Martin#9-Jan-07 8:35 
GeneralRe: actual Subversion Revision Pin
Martin#9-Jan-07 9:25
Martin#9-Jan-07 9:25 
QuestionData breakpoint Pin
Bekjong9-Jan-07 2:28
Bekjong9-Jan-07 2:28 
AnswerRe: Data breakpoint Pin
Eric Dahlvang9-Jan-07 3:26
Eric Dahlvang9-Jan-07 3:26 
GeneralRe: Data breakpoint Pin
Bekjong9-Jan-07 3:29
Bekjong9-Jan-07 3:29 
QuestionHow to access files in Unix server from windows machine through C# code Pin
gknath9-Jan-07 2:19
gknath9-Jan-07 2:19 

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.