Click here to Skip to main content
15,909,503 members
Home / Discussions / C#
   

C#

 
Answer[Wrong Forum] Pin
Keith Barrow31-Mar-10 5:20
professionalKeith Barrow31-Mar-10 5:20 
QuestionTabcontrol flicker Pin
Wannes Geysen31-Mar-10 4:24
Wannes Geysen31-Mar-10 4:24 
AnswerRe: Tabcontrol flicker Pin
Luc Pattyn31-Mar-10 4:39
sitebuilderLuc Pattyn31-Mar-10 4:39 
GeneralRe: Tabcontrol flicker Pin
Wannes Geysen31-Mar-10 4:57
Wannes Geysen31-Mar-10 4:57 
GeneralRe: Tabcontrol flicker Pin
Luc Pattyn31-Mar-10 5:54
sitebuilderLuc Pattyn31-Mar-10 5:54 
AnswerRe: Tabcontrol flicker Pin
Som Shekhar31-Mar-10 5:12
Som Shekhar31-Mar-10 5:12 
GeneralRe: Tabcontrol flicker Pin
Wannes Geysen31-Mar-10 5:18
Wannes Geysen31-Mar-10 5:18 
QuestionPrintDocument clipping / wrapping text problem Pin
Mark F.31-Mar-10 3:07
Mark F.31-Mar-10 3:07 
AnswerRe: PrintDocument clipping / wrapping text problem Pin
Luc Pattyn31-Mar-10 4:46
sitebuilderLuc Pattyn31-Mar-10 4:46 
General[Solved] Re: PrintDocument clipping / wrapping text problem Pin
Mark F.31-Mar-10 5:20
Mark F.31-Mar-10 5:20 
GeneralRe: [Solved] Re: PrintDocument clipping / wrapping text problem Pin
Luc Pattyn31-Mar-10 6:01
sitebuilderLuc Pattyn31-Mar-10 6:01 
QuestionPassing TextWriter through a function Pin
Steve-Co31-Mar-10 2:36
Steve-Co31-Mar-10 2:36 
AnswerRe: Passing TextWriter through a function Pin
Keith Barrow31-Mar-10 2:43
professionalKeith Barrow31-Mar-10 2:43 
You don't flush the text writer or close it. If you check the file before the writer is garbage collected, you can't be certain what will be in the file.
This should fix your problem:

C#
Main()
{
   using (TextWriter LogWriter = new StreamWriter(LogLocation))
   {
      for (i=0... etc loop      
      {
            MyFunction(LogWriter)      
      }
   }
}

MyFunction(TextWriter LogWriter)
{
   LogWriter.WriteLine("Hello World")
   LogWriter.Flush()
}

Dalek Dave: There are many words that some find offensive, Homosexuality, Alcoholism, Religion, Visual Basic, Manchester United, Butter.
Pete o'Hanlon: If it wasn't insulting tools, I'd say you were dumber than a bag of spanners.

GeneralRe: Passing TextWriter through a function Pin
Steve-Co31-Mar-10 2:47
Steve-Co31-Mar-10 2:47 
GeneralRe: Passing TextWriter through a function Pin
Keith Barrow31-Mar-10 2:58
professionalKeith Barrow31-Mar-10 2:58 
GeneralRe: Passing TextWriter through a function Pin
Mirko198031-Mar-10 3:00
Mirko198031-Mar-10 3:00 
AnswerRe: Passing TextWriter through a function Pin
R. Giskard Reventlov31-Mar-10 2:45
R. Giskard Reventlov31-Mar-10 2:45 
GeneralRe: Passing TextWriter through a function Pin
Luc Pattyn31-Mar-10 2:54
sitebuilderLuc Pattyn31-Mar-10 2:54 
GeneralRe: Passing TextWriter through a function Pin
R. Giskard Reventlov31-Mar-10 2:59
R. Giskard Reventlov31-Mar-10 2:59 
AnswerRe: Passing TextWriter through a function Pin
Steve-Co31-Mar-10 2:56
Steve-Co31-Mar-10 2:56 
QuestionSafe thread calls Pin
faheemnadeem31-Mar-10 1:41
faheemnadeem31-Mar-10 1:41 
AnswerRe: Safe thread calls Pin
Luc Pattyn31-Mar-10 1:52
sitebuilderLuc Pattyn31-Mar-10 1:52 
GeneralRe: Safe thread calls Pin
faheemnadeem31-Mar-10 2:04
faheemnadeem31-Mar-10 2:04 
GeneralRe: Safe thread calls Pin
Luc Pattyn31-Mar-10 2:26
sitebuilderLuc Pattyn31-Mar-10 2:26 
GeneralRe: Safe thread calls Pin
faheemnadeem31-Mar-10 2:39
faheemnadeem31-Mar-10 2:39 

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.