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

C#

 
Questionwriting in a file Pin
netJP12L9-Jan-07 6:12
netJP12L9-Jan-07 6:12 
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 
Hello,

I'm not sure if it's usefull to create a new instance of StreamWriter (in youre case 5) inside the for loop.
If yes, you would have to call the close method also in the loop, otherwise only the last StreamWriter instance would be closed (disposed).
If not, you should do this:

sw = new StreamWriter(@"C:\myfolder\path.txt");
for(int i=0;i<5;i++)
{
    sw.WriteLine(i.ToString());
    sw.Flush();
}
sw.Close();


All the best

Martin
GeneralRe: writing in a file Pin
Luc Pattyn9-Jan-07 9:47
sitebuilderLuc Pattyn9-Jan-07 9:47 
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 

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.