locked
StreamWriter Problems RRS feed

  • Question

  • I am trying to write a basic .net program that reads from one file with streamreader, scans each line for specific errors in formating and if the errors exist correct them in an output to another file that I've just renamed as same file name.cache.  For some reason the streamwriter is failing in mid sentence sometimes and I can't identify why, no errors or anything came up in the build section and I'm not sure if streamwriter has any known problems like this but can somebody help me.  Let me know if I need to post info like the code or something.
    Tuesday, December 20, 2011 6:25 AM

Answers

  • don't forget to .flush your streams =).  That resolved the issue.
    Tuesday, December 20, 2011 7:07 AM

All replies

  • don't forget to .flush your streams =).  That resolved the issue.
    Tuesday, December 20, 2011 7:07 AM
  • Hi Wesley,

    Welcome to the MSDN Forum.

    Thank you for sharing this solution here.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Wednesday, December 21, 2011 3:51 PM
    Moderator