Results 1 to 3 of 3

Thread: [RESOLVED] Binarywriter, current write position

  1. #1

    Thread Starter
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863

    Resolved [RESOLVED] Binarywriter, current write position

    How do I get the current write-position using the BinaryWriter. I need to store the position in order to read from that position afterwards. (I know it would give the position where the next write would start, that will be taken care of).
    Thanks
    You're welcome to rate this post!
    If your problem is solved, please use the Mark thread as resolved button


    Wait, I'm too old to hurry!

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Binarywriter, current write position

    The BinaryWriter doesn't expose that information but when you created the BinaryWriter you passed it a Stream, which has a Position property. That property will throw an exception if the Stream doesn't support seeking, e.g. a NetworkStream. You'll be fine with a FileStream though, which is the most common backing store.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863

    Re: Binarywriter, current write position

    I did it again, looking at the wrong spot all the time!
    I'm using a filestream already, but I was looking at the Binarywriter to find the actual position, a short look at the Filestream did give the information as needed!
    Thanks.
    You're welcome to rate this post!
    If your problem is solved, please use the Mark thread as resolved button


    Wait, I'm too old to hurry!

Posting Permissions

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



Click Here to Expand Forum to Full Width