You need to flush (place enough) your data into a file at the end of your code: oWriter.Flush(); //Save (Clears all buffers for the current writer and causes any buffered data to be written to the underlying stream.)
oWriter.Dispose(); //Then free this resource
As Yuval said, looking at the C # StreamWriter.cs class, he really calls the Flush method inside. See Here: Reference
source share