Cannot write to a closed TextWriter

This is a discussion on Cannot write to a closed TextWriter within the C# Programming forums, part of the General Programming Boards category; My problem was about to write an array to text file (I can make this) then I want to make ...

  1. #1
    Registered User
    Join Date
    Oct 2008
    Posts
    3

    Unhappy Cannot write to a closed TextWriter

    My problem was about to write an array to text file (I can make this) then I want to make another operations. This operations not about the text file. Just simple pressing sentences to monitor that I want. But I got an error message. ObjectDisposedException was unhandled. Cannot write to a closed TextWriter. Already I dont want to write this sentences to text. How can I solve this?

  2. #2
    Registered User
    Join Date
    Aug 2008
    Posts
    188
    don't close the textwriter until you're done writing.

  3. #3
    Registered User
    Join Date
    Oct 2008
    Posts
    85
    check that you are not re using a routine that thinks the stream is still open or uses a variable that is associated with the textwriter stream ?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. program to make a floppy write protected
    By shrijeetp in forum C Programming
    Replies: 1
    Last Post: 10-03-2005, 06:00 AM
  2. Reroute where programs write to
    By willc0de4food in forum C Programming
    Replies: 7
    Last Post: 09-21-2005, 04:48 PM
  3. Replies: 3
    Last Post: 03-04-2005, 01:46 PM
  4. Replies: 1
    Last Post: 10-13-2004, 12:15 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21