locked
Output file size RRS feed

  • Question

  • Hi,

    I have a problem to write a sting to a file. The output file I get is only 3kB, but my string is longer and I get only part of it in the output file. Here is the program code.

           

        OutFileName = "C:\Temp\gbxml.xml" ' this is for debug
    
        Dim fs As New FileStream(OutFileName, FileMode.Create)
    
        If fs Is Nothing Then Return False
    
        Dim oWrite As New StreamWriter(fs)
        oWrite.Write(strXML)
    
        fs.Close()
    
    

    What can I do?

    Thanks,
    EK

    Friday, December 17, 2010 6:19 PM

Answers

  • You might want to try oWrite.Flush() before closing the FileStream.
    • Marked as answer by E-Key Friday, December 17, 2010 6:31 PM
    Friday, December 17, 2010 6:26 PM

All replies

  • You might want to try oWrite.Flush() before closing the FileStream.
    • Marked as answer by E-Key Friday, December 17, 2010 6:31 PM
    Friday, December 17, 2010 6:26 PM
  • It works, Thank you!
    Friday, December 17, 2010 6:31 PM