I'm using a StreamWriter to write some data to a file.
System.IO.StreamWriter file = new System.IO.StreamWriter(path);
while(something_is_happening && my_flag_is_true)
file.WriteLine(some_text_goes_Inside);
file.close();
What i noticed is, till the close is called no data is written to the file.
Is there any way i can save the contents to the file before closing.
using
statement for your streamwriter.