CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    May 2014

    SteamWriter Problem - tooooo slowwwwwwwwwwwwwwww


    I am processing a large text file and making a lot of edits to it along the way and then writing it back using SteamWriter.

    Unfortunately it is dog slow compared to VB6 and I don't know what to do about it. I am self taught occasional dabbler and need to keep things on the more basic level as well.

    I am using VB.net Express 2010 and am wondering if some problems exist and are fixed in the 2013 version.

    thanks in advance

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004

    Re: SteamWriter Problem - tooooo slowwwwwwwwwwwwwwww

    Perhaps the slowness is due to your approach? Post the code using code tags so we can see what you're doing.

  3. #3
    Join Date
    May 2014

    Re: SteamWriter Problem - tooooo slowwwwwwwwwwwwwwww

    Sorry for the late replay. I was expecting an email if there was any response here.

    I scoured the internet and found a lot of dudes solving with with all sort of create methods that were too complicated for my novice brain. I eventually found another option for the steam-writer that seems to work faster. It was quite buried (to me anyway)

    I think my clue came from here

    This worked
    Dim myoutputfile As String = lblFullPath.Text & "\" & "\Spinner\" & strfilename
    Dim swrfile As System.IO.StreamWriter
    swrfile = System.IO.File.AppendText(myoutputfile)

    I did not keep my original code but my tutorial for my original code only seems be using the first line of this example (and then the write commands). My tutorial was Sams teach yourself - 2010.

  4. #4
    Join Date
    May 2014

    Re: SteamWriter Problem - tooooo slowwwwwwwwwwwwwwww

    Wow, I really should read my stuff before posting. Please point me to an edit option if there is one to get rid of my typos.

  5. #5
    DataMiser is offline Super Moderator Power Poster
    Join Date
    Jul 2008

    Re: SteamWriter Problem - tooooo slowwwwwwwwwwwwwwww

    I am curious how you were doing it before. I've not saw any issues using streamwriter. I would suspect it was related to your methods.
    Always use [code][/code] tags when posting code.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.